forked from apache/tvm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlibinfo.cc
369 lines (306 loc) · 10.6 KB
/
libinfo.cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
#include <tvm/runtime/object.h>
#include <tvm/runtime/registry.h>
#ifndef TVM_INFO_GIT_COMMIT_HASH
#define TVM_INFO_GIT_COMMIT_HASH "NOT-FOUND"
#endif
#ifndef TVM_INFO_GIT_COMMIT_TIME
#define TVM_INFO_GIT_COMMIT_TIME "NOT-FOUND"
#endif
#ifndef TVM_INFO_LLVM_VERSION
#define TVM_INFO_LLVM_VERSION "NOT-FOUND"
#endif
#ifndef TVM_INFO_MLIR_VERSION
#define TVM_INFO_MLIR_VERSION "NOT-FOUND"
#endif
#ifndef TVM_INFO_USE_CUDA
#define TVM_INFO_USE_CUDA "NOT-FOUND"
#endif
#ifndef TVM_INFO_USE_NCCL
#define TVM_INFO_USE_NCCL "NOT-FOUND"
#endif
#ifndef TVM_INFO_CUDA_VERSION
#define TVM_INFO_CUDA_VERSION "NOT-FOUND"
#endif
#ifndef TVM_INFO_USE_OPENCL
#define TVM_INFO_USE_OPENCL "NOT-FOUND"
#endif
#ifndef TVM_INFO_USE_OPENCL_ENABLE_HOST_PTR
#define TVM_INFO_USE_OPENCL_ENABLE_HOST_PTR "NOT-FOUND"
#endif
#ifndef TVM_INFO_USE_OPENCL_GTEST
#define TVM_INFO_USE_OPENCL_GTEST "NOT-FOUND"
#endif
#ifndef TVM_INFO_USE_VULKAN
#define TVM_INFO_USE_VULKAN "NOT-FOUND"
#endif
#ifndef TVM_INFO_USE_METAL
#define TVM_INFO_USE_METAL "NOT-FOUND"
#endif
#ifndef TVM_INFO_USE_ROCM
#define TVM_INFO_USE_ROCM "NOT-FOUND"
#endif
#ifndef TVM_INFO_ROCM_PATH
#define TVM_INFO_ROCM_PATH "NOT-FOUND"
#endif
#ifndef TVM_INFO_USE_RCCL
#define TVM_INFO_USE_RCCL "NOT-FOUND"
#endif
#ifndef TVM_INFO_USE_HEXAGON
#define TVM_INFO_USE_HEXAGON "NOT-FOUND"
#endif
#ifndef TVM_INFO_USE_HEXAGON_SDK
#define TVM_INFO_USE_HEXAGON_SDK "NOT-FOUND"
#endif
#ifndef TVM_INFO_USE_HEXAGON_GTEST
#define TVM_INFO_USE_HEXAGON_GTEST "NOT-FOUND"
#endif
#ifndef TVM_INFO_USE_RPC
#define TVM_INFO_USE_RPC "NOT-FOUND"
#endif
#ifndef TVM_INFO_USE_THREADS
#define TVM_INFO_USE_THREADS "NOT-FOUND"
#endif
#ifndef TVM_INFO_USE_LLVM
#define TVM_INFO_USE_LLVM "NOT-FOUND"
#endif
#ifndef TVM_INFO_USE_STACKVM_RUNTIME
#define TVM_INFO_USE_STACKVM_RUNTIME "NOT-FOUND"
#endif
#ifndef TVM_INFO_USE_GRAPH_EXECUTOR
#define TVM_INFO_USE_GRAPH_EXECUTOR "NOT-FOUND"
#endif
#ifndef TVM_INFO_USE_PROFILER
#define TVM_INFO_USE_PROFILER "NOT-FOUND"
#endif
#ifndef TVM_INFO_USE_OPENMP
#define TVM_INFO_USE_OPENMP "NOT-FOUND"
#endif
#ifndef TVM_INFO_USE_RELAY_DEBUG
#define TVM_INFO_USE_RELAY_DEBUG "NOT-FOUND"
#endif
#ifndef TVM_INFO_USE_RTTI
#define TVM_INFO_USE_RTTI "NOT-FOUND"
#endif
#ifndef TVM_INFO_USE_MSVC_MT
#define TVM_INFO_USE_MSVC_MT "NOT-FOUND"
#endif
#ifndef TVM_INFO_USE_MICRO
#define TVM_INFO_USE_MICRO "NOT-FOUND"
#endif
#ifndef TVM_INFO_INSTALL_DEV
#define TVM_INFO_INSTALL_DEV "NOT-FOUND"
#endif
#ifndef TVM_INFO_HIDE_PRIVATE_SYMBOLS
#define TVM_INFO_HIDE_PRIVATE_SYMBOLS "NOT-FOUND"
#endif
#ifndef TVM_INFO_USE_TF_TVMDSOOP
#define TVM_INFO_USE_TF_TVMDSOOP "NOT-FOUND"
#endif
#ifndef TVM_INFO_USE_FALLBACK_STL_MAP
#define TVM_INFO_USE_FALLBACK_STL_MAP "NOT-FOUND"
#endif
#ifndef TVM_INFO_USE_BYODT_POSIT
#define TVM_INFO_USE_BYODT_POSIT "NOT-FOUND"
#endif
#ifndef TVM_INFO_USE_BLAS
#define TVM_INFO_USE_BLAS "NOT-FOUND"
#endif
#ifndef TVM_INFO_USE_MKL
#define TVM_INFO_USE_MKL "NOT-FOUND"
#endif
#ifndef TVM_INFO_USE_AMX
#define TVM_INFO_USE_AMX "NOT-FOUND"
#endif
#ifndef TVM_INFO_USE_DNNL
#define TVM_INFO_USE_DNNL "NOT-FOUND"
#endif
#ifndef TVM_INFO_USE_CUDNN
#define TVM_INFO_USE_CUDNN "NOT-FOUND"
#endif
#ifndef TVM_INFO_USE_CUBLAS
#define TVM_INFO_USE_CUBLAS "NOT-FOUND"
#endif
#ifndef TVM_INFO_USE_THRUST
#define TVM_INFO_USE_THRUST "NOT-FOUND"
#endif
#ifndef TVM_INFO_USE_CURAND
#define TVM_INFO_USE_CURAND "NOT-FOUND"
#endif
#ifndef TVM_INFO_USE_MIOPEN
#define TVM_INFO_USE_MIOPEN "NOT-FOUND"
#endif
#ifndef TVM_INFO_USE_ROCBLAS
#define TVM_INFO_USE_ROCBLAS "NOT-FOUND"
#endif
#ifndef TVM_INFO_USE_SORT
#define TVM_INFO_USE_SORT "NOT-FOUND"
#endif
#ifndef TVM_INFO_USE_NNPACK
#define TVM_INFO_USE_NNPACK "NOT-FOUND"
#endif
#ifndef TVM_INFO_USE_RANDOM
#define TVM_INFO_USE_RANDOM "NOT-FOUND"
#endif
#ifndef TVM_INFO_USE_MICRO_STANDALONE_RUNTIME
#define TVM_INFO_USE_MICRO_STANDALONE_RUNTIME "NOT-FOUND"
#endif
#ifndef TVM_INFO_USE_CPP_RPC
#define TVM_INFO_USE_CPP_RPC "NOT-FOUND"
#endif
#ifndef TVM_INFO_USE_CPP_RTVM
#define TVM_INFO_USE_CPP_RTVM "NOT-FOUND"
#endif
#ifndef TVM_INFO_USE_TFLITE
#define TVM_INFO_USE_TFLITE "NOT-FOUND"
#endif
#ifndef TVM_INFO_USE_TENSORFLOW_PATH
#define TVM_INFO_USE_TENSORFLOW_PATH "NOT-FOUND"
#endif
#ifndef TVM_INFO_USE_COREML
#define TVM_INFO_USE_COREML "NOT-FOUND"
#endif
#ifndef TVM_INFO_USE_TARGET_ONNX
#define TVM_INFO_USE_TARGET_ONNX "NOT-FOUND"
#endif
#ifndef TVM_INFO_USE_ARM_COMPUTE_LIB
#define TVM_INFO_USE_ARM_COMPUTE_LIB "NOT-FOUND"
#endif
#ifndef TVM_INFO_USE_ARM_COMPUTE_LIB_GRAPH_EXECUTOR
#define TVM_INFO_USE_ARM_COMPUTE_LIB_GRAPH_EXECUTOR "NOT-FOUND"
#endif
#ifndef TVM_INFO_INDEX_DEFAULT_I64
#define TVM_INFO_INDEX_DEFAULT_I64 "NOT-FOUND"
#endif
#ifndef TVM_CXX_COMPILER_PATH
#define TVM_CXX_COMPILER_PATH ""
#endif
#ifndef TVM_INFO_USE_CCACHE
#define TVM_INFO_USE_CCACHE "NOT-FOUND"
#endif
namespace tvm {
/*!
* \brief Get a dictionary containing compile-time info, including cmake flags and git commit hash
* \return The compile-time info
*/
TVM_DLL Map<String, String> GetLibInfo() {
Map<String, String> result = {
{"BUILD_STATIC_RUNTIME", TVM_INFO_BUILD_STATIC_RUNTIME},
{"BUILD_DUMMY_LIBTVM", TVM_INFO_BUILD_DUMMY_LIBTVM},
{"COMPILER_RT_PATH", TVM_INFO_COMPILER_RT_PATH},
{"CUDA_VERSION", TVM_INFO_CUDA_VERSION},
{"DLPACK_PATH", TVM_INFO_DLPACK_PATH},
{"DMLC_PATH", TVM_INFO_DMLC_PATH},
{"GIT_COMMIT_HASH", TVM_INFO_GIT_COMMIT_HASH},
{"GIT_COMMIT_TIME", TVM_INFO_GIT_COMMIT_TIME},
{"HIDE_PRIVATE_SYMBOLS", TVM_INFO_HIDE_PRIVATE_SYMBOLS},
{"INDEX_DEFAULT_I64", TVM_INFO_INDEX_DEFAULT_I64},
{"INSTALL_DEV", TVM_INFO_INSTALL_DEV},
{"LLVM_VERSION", TVM_INFO_LLVM_VERSION},
{"MLIR_VERSION", TVM_INFO_MLIR_VERSION},
{"PICOJSON_PATH", TVM_INFO_PICOJSON_PATH},
{"RANG_PATH", TVM_INFO_RANG_PATH},
{"ROCM_PATH", TVM_INFO_ROCM_PATH},
{"SUMMARIZE", TVM_INFO_SUMMARIZE},
{"TVM_CXX_COMPILER_PATH", TVM_CXX_COMPILER_PATH},
{"USE_ALTERNATIVE_LINKER", TVM_INFO_USE_ALTERNATIVE_LINKER},
{"USE_AOT_EXECUTOR", TVM_INFO_USE_AOT_EXECUTOR},
{"USE_ARM_COMPUTE_LIB_GRAPH_EXECUTOR", TVM_INFO_USE_ARM_COMPUTE_LIB_GRAPH_EXECUTOR},
{"USE_ARM_COMPUTE_LIB", TVM_INFO_USE_ARM_COMPUTE_LIB},
{"USE_BLAS", TVM_INFO_USE_BLAS},
{"USE_BNNS", TVM_INFO_USE_BNNS},
{"USE_BYODT_POSIT", TVM_INFO_USE_BYODT_POSIT},
{"USE_CMSISNN", TVM_INFO_USE_CMSISNN},
{"USE_COREML", TVM_INFO_USE_COREML},
{"USE_CPP_RPC", TVM_INFO_USE_CPP_RPC},
{"USE_CPP_RTVM", TVM_INFO_USE_CPP_RTVM},
{"USE_CUBLAS", TVM_INFO_USE_CUBLAS},
{"USE_CUDA", TVM_INFO_USE_CUDA},
{"USE_NCCL", TVM_INFO_USE_NCCL},
{"USE_CUDNN", TVM_INFO_USE_CUDNN},
{"USE_CUSTOM_LOGGING", TVM_INFO_USE_CUSTOM_LOGGING},
{"USE_CUTLASS", TVM_INFO_USE_CUTLASS},
{"USE_AMX", TVM_INFO_USE_AMX},
{"USE_DNNL", TVM_INFO_USE_DNNL},
{"USE_ETHOSN", TVM_INFO_USE_ETHOSN},
{"USE_ETHOSU", TVM_INFO_USE_ETHOSU},
{"USE_FALLBACK_STL_MAP", TVM_INFO_USE_FALLBACK_STL_MAP},
{"USE_GRAPH_EXECUTOR_CUDA_GRAPH", TVM_INFO_USE_GRAPH_EXECUTOR_CUDA_GRAPH},
{"USE_GRAPH_EXECUTOR", TVM_INFO_USE_GRAPH_EXECUTOR},
{"USE_GTEST", TVM_INFO_USE_GTEST},
{"USE_HEXAGON", TVM_INFO_USE_HEXAGON},
{"USE_HEXAGON_RPC", TVM_INFO_USE_HEXAGON_RPC},
{"USE_HEXAGON_SDK", TVM_INFO_USE_HEXAGON_SDK},
{"USE_HEXAGON_GTEST", TVM_INFO_USE_HEXAGON_GTEST},
{"USE_HEXAGON_EXTERNAL_LIBS", TVM_INFO_USE_HEXAGON_EXTERNAL_LIBS},
{"USE_IOS_RPC", TVM_INFO_USE_IOS_RPC},
{"USE_KHRONOS_SPIRV", TVM_INFO_USE_KHRONOS_SPIRV},
{"USE_LIBBACKTRACE", TVM_INFO_USE_LIBBACKTRACE},
{"USE_LIBTORCH", TVM_INFO_USE_LIBTORCH},
{"USE_LLVM", TVM_INFO_USE_LLVM},
{"USE_MLIR", TVM_INFO_USE_MLIR},
{"USE_METAL", TVM_INFO_USE_METAL},
{"USE_MICRO_STANDALONE_RUNTIME", TVM_INFO_USE_MICRO_STANDALONE_RUNTIME},
{"USE_MICRO", TVM_INFO_USE_MICRO},
{"USE_MIOPEN", TVM_INFO_USE_MIOPEN},
{"USE_MKL", TVM_INFO_USE_MKL},
{"USE_MSVC_MT", TVM_INFO_USE_MSVC_MT},
{"USE_NNPACK", TVM_INFO_USE_NNPACK},
{"USE_OPENCL", TVM_INFO_USE_OPENCL},
{"USE_OPENCL_ENABLE_HOST_PTR", TVM_INFO_USE_OPENCL_ENABLE_HOST_PTR},
{"USE_OPENCL_GTEST", TVM_INFO_USE_OPENCL_GTEST},
{"USE_OPENMP", TVM_INFO_USE_OPENMP},
{"USE_PAPI", TVM_INFO_USE_PAPI},
{"USE_PROFILER", TVM_INFO_USE_PROFILER},
{"USE_PT_TVMDSOOP", TVM_INFO_USE_PT_TVMDSOOP},
{"USE_RANDOM", TVM_INFO_USE_RANDOM},
{"USE_RELAY_DEBUG", TVM_INFO_USE_RELAY_DEBUG},
{"USE_ROCBLAS", TVM_INFO_USE_ROCBLAS},
{"USE_ROCM", TVM_INFO_USE_ROCM},
{"USE_RCCL", TVM_INFO_USE_RCCL},
{"USE_RPC", TVM_INFO_USE_RPC},
{"USE_RTTI", TVM_INFO_USE_RTTI},
{"USE_RUST_EXT", TVM_INFO_USE_RUST_EXT},
{"USE_SORT", TVM_INFO_USE_SORT},
{"USE_SPIRV_KHR_INTEGER_DOT_PRODUCT", TVM_INFO_USE_SPIRV_KHR_INTEGER_DOT_PRODUCT},
{"USE_STACKVM_RUNTIME", TVM_INFO_USE_STACKVM_RUNTIME},
{"USE_TARGET_ONNX", TVM_INFO_USE_TARGET_ONNX},
{"USE_TENSORFLOW_PATH", TVM_INFO_USE_TENSORFLOW_PATH},
{"USE_TENSORRT_CODEGEN", TVM_INFO_USE_TENSORRT_CODEGEN},
{"USE_TENSORRT_RUNTIME", TVM_INFO_USE_TENSORRT_RUNTIME},
{"USE_TF_TVMDSOOP", TVM_INFO_USE_TF_TVMDSOOP},
{"USE_TFLITE", TVM_INFO_USE_TFLITE},
{"USE_THREADS", TVM_INFO_USE_THREADS},
{"USE_THRUST", TVM_INFO_USE_THRUST},
{"USE_CURAND", TVM_INFO_USE_CURAND},
{"USE_VITIS_AI", TVM_INFO_USE_VITIS_AI},
{"USE_VULKAN", TVM_INFO_USE_VULKAN},
{"USE_CLML", TVM_INFO_USE_CLML},
{"TVM_CLML_VERSION", TVM_INFO_USE_TVM_CLML_VERSION},
{"USE_CLML_GRAPH_EXECUTOR", TVM_INFO_USE_CLML_GRAPH_EXECUTOR},
{"USE_UMA", TVM_INFO_USE_UMA},
{"USE_VERILATOR", TVM_INFO_USE_VERILATOR},
{"USE_CCACHE", TVM_INFO_USE_CCACHE},
{"BACKTRACE_ON_SEGFAULT", TVM_INFO_BACKTRACE_ON_SEGFAULT},
};
return result;
}
TVM_REGISTER_GLOBAL("support.GetLibInfo").set_body_typed(GetLibInfo);
} // namespace tvm