nvrtc.pxd 1.23 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
from libc.stdint cimport intptr_t


###############################################################################
# Types
###############################################################################

IF CUPY_USE_CUDA_PYTHON:
    from cuda.cnvrtc cimport *
    # Aliases for compatibillity with existing CuPy codebase.
    # TODO(kmaehashi): Remove these aliases.
    ctypedef nvrtcResult Result
    ctypedef nvrtcProgram Program
ELSE:
    cdef extern from *:
        ctypedef int Result 'nvrtcResult'
        ctypedef void* Program 'nvrtcProgram'


cpdef check_status(int status)

cpdef tuple getVersion()
cpdef tuple getSupportedArchs()


###############################################################################
# Program
###############################################################################

cpdef intptr_t createProgram(unicode src, unicode name, headers,
                             include_names) except? 0
cpdef destroyProgram(intptr_t prog)
cpdef compileProgram(intptr_t prog, options)
cpdef bytes getPTX(intptr_t prog)
cpdef bytes getCUBIN(intptr_t prog)
cpdef bytes getNVVM(intptr_t prog)
cpdef unicode getProgramLog(intptr_t prog)
cpdef addNameExpression(intptr_t prog, str name)
cpdef str getLoweredName(intptr_t prog, str name)