tvm
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 
20 /*
21  * \file tvm/runtime/base.h
22  * \brief base macros
23  */
24 #ifndef TVM_RUNTIME_BASE_H_
25 #define TVM_RUNTIME_BASE_H_
26 
27 // TVM runtime fully relies on TVM FFI C API
28 // we will avoid defining extra C APIs here
29 #include <tvm/ffi/c_api.h>
30 
31 // TVM version
32 #define TVM_VERSION "0.21.dev0"
33 
34 // define extra macros for TVM DLL exprt
35 #ifdef __EMSCRIPTEN__
36 #include <emscripten/emscripten.h>
37 #define TVM_DLL EMSCRIPTEN_KEEPALIVE
38 #endif
39 
40 // helper macro to suppress unused warning
41 #if defined(__GNUC__)
42 #define TVM_ATTRIBUTE_UNUSED __attribute__((unused))
43 #else
44 #define TVM_ATTRIBUTE_UNUSED
45 #endif
46 
47 #ifndef TVM_DLL
48 #ifdef _WIN32
49 #ifdef TVM_EXPORTS
50 #define TVM_DLL __declspec(dllexport)
51 #else
52 #define TVM_DLL __declspec(dllimport)
53 #endif
54 #else
55 #define TVM_DLL __attribute__((visibility("default")))
56 #endif
57 #endif
58 
59 #endif // TVM_RUNTIME_BASE_H_