cupy_hiprtc.h 2.1 KB
Newer Older
root's avatar
root committed
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
#ifndef INCLUDE_GUARD_HIP_CUPY_HIPRTC_H
#define INCLUDE_GUARD_HIP_CUPY_HIPRTC_H

#include <hip/hiprtc.h>

extern "C" {

typedef hiprtcResult nvrtcResult;
const nvrtcResult NVRTC_SUCCESS = HIPRTC_SUCCESS;

typedef hiprtcProgram nvrtcProgram;

const char *nvrtcGetErrorString(nvrtcResult result) {
    return hiprtcGetErrorString(result);
}

nvrtcResult nvrtcVersion(int* major, int* minor) {
    return hiprtcVersion(major, minor);
}

nvrtcResult nvrtcCreateProgram(nvrtcProgram* prog, const char* src,
                               const char* name, int numHeaders,
                               const char** headers,
                               const char** includeNames) {
    return hiprtcCreateProgram(prog, src, name, numHeaders, headers, includeNames);
}

nvrtcResult nvrtcDestroyProgram(nvrtcProgram* prog) {
    return hiprtcDestroyProgram(prog);
}

nvrtcResult nvrtcCompileProgram(nvrtcProgram prog, int numOptions,
                                const char** options) {
    return hiprtcCompileProgram(prog, numOptions, options);
}

nvrtcResult nvrtcGetPTXSize(nvrtcProgram prog, std::size_t* codeSizeRet) {
    return hiprtcGetCodeSize(prog, codeSizeRet);
}

nvrtcResult nvrtcGetPTX(nvrtcProgram prog, char* code) {
    return hiprtcGetCode(prog, code);
}

nvrtcResult nvrtcGetCUBINSize(...) {
    return HIPRTC_ERROR_COMPILATION;
}

nvrtcResult nvrtcGetCUBIN(...) {
    return HIPRTC_ERROR_COMPILATION;
}

nvrtcResult nvrtcGetProgramLogSize(nvrtcProgram prog, std::size_t* logSizeRet) {
    return hiprtcGetProgramLogSize(prog, logSizeRet);
}

nvrtcResult nvrtcGetProgramLog(nvrtcProgram prog, char* log) {
    return hiprtcGetProgramLog(prog, log);
}

nvrtcResult nvrtcAddNameExpression(nvrtcProgram prog,
                                   const char* name_expression) {
    return hiprtcAddNameExpression(prog, name_expression);
}

nvrtcResult nvrtcGetLoweredName(nvrtcProgram prog,
                                const char* name_expression,
                                const char** lowered_name ) {
    return hiprtcGetLoweredName(prog, name_expression, lowered_name);
}

}

#endif // #ifndef INCLUDE_GUARD_HIP_CUPY_HIPRTC_H