Caffe2 - C++ API
A deep learning, cross platform ML framework
thnvrtc.h
1 #pragma once
2 
3 #include <cuda.h>
4 #include <nvrtc.h>
5 
6 // See [USE OF NVRTC AND DRIVER API]
7 
8 #define TORCH_FORALL_NVRTC(_) \
9  _(nvrtcVersion) \
10  _(nvrtcCreateProgram) \
11  _(nvrtcDestroyProgram) \
12  _(nvrtcGetPTXSize) \
13  _(nvrtcGetPTX) \
14  _(cuModuleLoadData) \
15  _(cuModuleGetFunction) \
16  _(cuOccupancyMaxActiveBlocksPerMultiprocessor) \
17  _(cuGetErrorString) \
18  _(nvrtcGetErrorString) \
19  _(cuLaunchKernel) \
20  _(nvrtcCompileProgram) \
21  _(cuCtxGetCurrent) \
22  _(cuModuleUnload) \
23  _(cuDevicePrimaryCtxGetState)
24 
25 extern "C" typedef struct THNVRTC {
26 #define CREATE_MEMBER(name) decltype(&name) name;
27  TORCH_FORALL_NVRTC(CREATE_MEMBER)
28 #undef CREATE_MEMBER
29 } THNVRTC;
30 
31 extern "C" THNVRTC* torch_load_nvrtc();