tvm
Loading...
Searching...
No Matches
base.h
Go to the documentation of this file.
1/*
2 * Licensed to the Apache Software Foundation (ASF) under one
3 * or more contributor license agreements. See the NOTICE file
4 * distributed with this work for additional information
5 * regarding copyright ownership. The ASF licenses this file
6 * to you under the Apache License, Version 2.0 (the
7 * "License"); you may not use this file except in compliance
8 * with the License. You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing,
13 * software distributed under the License is distributed on an
14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 * KIND, either express or implied. See the License for the
16 * specific language governing permissions and limitations
17 * under the License.
18 */
19
24#ifndef TVM_BASE_H_
25#define TVM_BASE_H_
26
27// TVM_EXPORTS selects compiler exports on MSVC; consumers import them.
28// TVM_DLL_EXPORT always exports. Embedders may override TVM_DLL.
29#ifdef __EMSCRIPTEN__
30#include <emscripten/emscripten.h>
31#endif
32
33// --- TVM_DLL family (libtvm_compiler) ---
34#if !defined(TVM_DLL) && defined(__EMSCRIPTEN__)
35#define TVM_DLL EMSCRIPTEN_KEEPALIVE
36#define TVM_DLL_EXPORT EMSCRIPTEN_KEEPALIVE
37#endif
38#if !defined(TVM_DLL) && defined(_MSC_VER)
39#ifdef TVM_EXPORTS
40#define TVM_DLL __declspec(dllexport)
41#else
42#define TVM_DLL __declspec(dllimport)
43#endif
44#define TVM_DLL_EXPORT __declspec(dllexport)
45#endif
46#ifndef TVM_DLL
47#define TVM_DLL __attribute__((visibility("default")))
48#define TVM_DLL_EXPORT __attribute__((visibility("default")))
49#endif
50
51#endif // TVM_BASE_H_