Skip to content

Commit

Permalink
enable LTO linker items only for cuda 12
Browse files Browse the repository at this point in the history
  • Loading branch information
isVoid committed Oct 24, 2024
1 parent 27b304d commit b42c67d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions numba_cuda/numba/cuda/cudadrv/nvrtc.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
from numba.core import config
from numba.cuda.cudadrv.error import (NvrtcError, NvrtcCompilationError,
NvrtcSupportError)
from cuda.cuda.cudadrv.driver import get_version

import functools
import os
Expand Down Expand Up @@ -106,9 +105,6 @@ class NVRTC:
'nvrtcGetProgramLog': (nvrtc_result, nvrtc_program, c_char_p),
}

if get_version() >= (12, 0):
_PROTOTYPES |= _CU12ONLY_PROTOTYPES

# Singleton reference
__INSTANCE = None

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

from numba.cuda.cudadrv.runtime import get_version
if get_version() >= (12, 0):
inst._PROTOTYPES |= inst._CU12ONLY_PROTOTYPES

# Find & populate functions
for name, proto in inst._PROTOTYPES.items():
func = getattr(lib, name)
Expand Down

0 comments on commit b42c67d

Please sign in to comment.