Skip to content

Commit b42c67d

Browse files
committed
enable LTO linker items only for cuda 12
1 parent 27b304d commit b42c67d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

numba_cuda/numba/cuda/cudadrv/nvrtc.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
from numba.core import config
44
from numba.cuda.cudadrv.error import (NvrtcError, NvrtcCompilationError,
55
NvrtcSupportError)
6-
from cuda.cuda.cudadrv.driver import get_version
76

87
import functools
98
import os
@@ -106,9 +105,6 @@ class NVRTC:
106105
'nvrtcGetProgramLog': (nvrtc_result, nvrtc_program, c_char_p),
107106
}
108107

109-
if get_version() >= (12, 0):
110-
_PROTOTYPES |= _CU12ONLY_PROTOTYPES
111-
112108
# Singleton reference
113109
__INSTANCE = None
114110

@@ -123,6 +119,10 @@ def __new__(cls):
123119
cls.__INSTANCE = None
124120
raise NvrtcSupportError("NVRTC cannot be loaded") from e
125121

122+
from numba.cuda.cudadrv.runtime import get_version
123+
if get_version() >= (12, 0):
124+
inst._PROTOTYPES |= inst._CU12ONLY_PROTOTYPES
125+
126126
# Find & populate functions
127127
for name, proto in inst._PROTOTYPES.items():
128128
func = getattr(lib, name)

0 commit comments

Comments
 (0)