Skip to content

Commit

Permalink
Merge pull request #8142 from gmarkall/cuda-9.2-missed
Browse files Browse the repository at this point in the history
CUDA: Fix some missed changes from dropping 9.2
  • Loading branch information
sklam committed Jun 9, 2022
2 parents 19117b3 + 8c1b991 commit 2f89d45
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 20 deletions.
4 changes: 2 additions & 2 deletions buildscripts/condarecipe.local/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ requirements:
# Exclude 0.3.20 too
# https://github.com/numba/numba/issues/8096
- libopenblas >=0.3.18, !=0.3.20 # [arm64]
# CUDA 9.2 or later is required for CUDA support
- cudatoolkit >=9.2
# CUDA 10.2 or later is required for CUDA support
- cudatoolkit >=10.2
# scipy 1.0 or later
- scipy >=1.0
# CUDA Python 11.6 or later
Expand Down
6 changes: 1 addition & 5 deletions numba/cuda/cudadrv/driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,10 +201,6 @@ def _getpid():

ERROR_MAP = _build_reverse_error_map()

MISSING_FUNCTION_ERRMSG = """driver missing function: %s.
Requires CUDA 9.2 or above.
"""


class Driver(object):
"""
Expand Down Expand Up @@ -371,7 +367,7 @@ def _find_api(self, fname):
# Not found.
# Delay missing function error to use
def absent_function(*args, **kws):
raise CudaDriverError(MISSING_FUNCTION_ERRMSG % fname)
raise CudaDriverError(f'Driver missing function: {fname}')

setattr(self, fname, absent_function)
return absent_function
Expand Down
14 changes: 1 addition & 13 deletions numba/cuda/cudadrv/nvvm.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,19 +132,7 @@ def __new__(cls):

# Find & populate functions
for name, proto in inst._PROTOTYPES.items():
try:
func = getattr(inst.driver, name)
except AttributeError:
# CUDA 9.2 has no nvvmLazyAddModuleToProgram, but
# nvvmAddModuleToProgram fulfils the same function,
# just less efficiently, so we work around this here.
# This workaround to be removed once support for CUDA
# 9.2 is dropped.
if name == 'nvvmLazyAddModuleToProgram':
func = getattr(inst.driver,
'nvvmAddModuleToProgram')
else:
raise
func = getattr(inst.driver, name)
func.restype = proto[0]
func.argtypes = proto[1:]
setattr(inst, name, func)
Expand Down

0 comments on commit 2f89d45

Please sign in to comment.