From 126c3867d1a1d2e2fa983f63793633968c6697b9 Mon Sep 17 00:00:00 2001 From: Graham Markall Date: Tue, 22 Oct 2024 10:17:00 +0100 Subject: [PATCH] Rename ENABLE_PYNVJITLINK for consistency - As a config variable, it is called `CUDA_ENABLE_PYNVJITLINK` - As an environment variable, it is `NUMBA_CUDA_ENABLE_PYNVJITLINK` --- ci/test_conda_pynvjitlink.sh | 2 +- ci/test_wheel_pynvjitlink.sh | 2 +- numba_cuda/numba/cuda/cudadrv/driver.py | 16 ++++++++-------- .../numba/cuda/tests/cudadrv/test_nvjitlink.py | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/ci/test_conda_pynvjitlink.sh b/ci/test_conda_pynvjitlink.sh index 71e41e4..22c0d67 100755 --- a/ci/test_conda_pynvjitlink.sh +++ b/ci/test_conda_pynvjitlink.sh @@ -69,7 +69,7 @@ popd rapids-logger "Run Tests" -ENABLE_PYNVJITLINK=1 NUMBA_CUDA_TEST_BIN_DIR=$NUMBA_CUDA_TEST_BIN_DIR python -m numba.runtests numba.cuda.tests -v +NUMBA_CUDA_ENABLE_PYNVJITLINK=1 NUMBA_CUDA_TEST_BIN_DIR=$NUMBA_CUDA_TEST_BIN_DIR python -m numba.runtests numba.cuda.tests -v popd diff --git a/ci/test_wheel_pynvjitlink.sh b/ci/test_wheel_pynvjitlink.sh index 0838bda..b7914be 100755 --- a/ci/test_wheel_pynvjitlink.sh +++ b/ci/test_wheel_pynvjitlink.sh @@ -42,6 +42,6 @@ rapids-logger "Show Numba system info" python -m numba --sysinfo rapids-logger "Run Tests" -ENABLE_PYNVJITLINK=1 NUMBA_CUDA_TEST_BIN_DIR=$NUMBA_CUDA_TEST_BIN_DIR python -m numba.runtests numba.cuda.tests -v +NUMBA_CUDA_ENABLE_PYNVJITLINK=1 NUMBA_CUDA_TEST_BIN_DIR=$NUMBA_CUDA_TEST_BIN_DIR python -m numba.runtests numba.cuda.tests -v popd diff --git a/numba_cuda/numba/cuda/cudadrv/driver.py b/numba_cuda/numba/cuda/cudadrv/driver.py index d59ecf6..ccb34a8 100644 --- a/numba_cuda/numba/cuda/cudadrv/driver.py +++ b/numba_cuda/numba/cuda/cudadrv/driver.py @@ -83,11 +83,11 @@ def _readenv(name, ctor, default): ) ENABLE_PYNVJITLINK = ( - _readenv("ENABLE_PYNVJITLINK", bool, False) - or getattr(config, "ENABLE_PYNVJITLINK", False) + _readenv("NUMBA_CUDA_ENABLE_PYNVJITLINK", bool, False) + or getattr(config, "CUDA_ENABLE_PYNVJITLINK", False) ) -if not hasattr(config, "ENABLE_PYNVJITLINK"): - config.ENABLE_PYNVJITLINK = ENABLE_PYNVJITLINK +if not hasattr(config, "CUDA_ENABLE_PYNVJITLINK"): + config.CUDA_ENABLE_PYNVJITLINK = ENABLE_PYNVJITLINK if ENABLE_PYNVJITLINK: try: @@ -100,7 +100,7 @@ def _readenv(name, ctor, default): if config.CUDA_ENABLE_MINOR_VERSION_COMPATIBILITY: raise ValueError( "Can't set CUDA_ENABLE_MINOR_VERSION_COMPATIBILITY and " - "ENABLE_PYNVJITLINK at the same time" + "CUDA_ENABLE_PYNVJITLINK at the same time" ) @@ -2612,13 +2612,13 @@ def new(cls, and driver_ver >= (12, 0) ): raise ValueError( - "Use ENABLE_PYNVJITLINK for CUDA >= 12.0 MVC" + "Use CUDA_ENABLE_PYNVJITLINK for CUDA >= 12.0 MVC" ) - if config.ENABLE_PYNVJITLINK and driver_ver < (12, 0): + if config.CUDA_ENABLE_PYNVJITLINK and driver_ver < (12, 0): raise ValueError( "Enabling pynvjitlink requires CUDA 12." ) - if config.ENABLE_PYNVJITLINK: + if config.CUDA_ENABLE_PYNVJITLINK: linker = PyNvJitLinker elif config.CUDA_ENABLE_MINOR_VERSION_COMPATIBILITY: diff --git a/numba_cuda/numba/cuda/tests/cudadrv/test_nvjitlink.py b/numba_cuda/numba/cuda/tests/cudadrv/test_nvjitlink.py index e9ff671..8d4e085 100644 --- a/numba_cuda/numba/cuda/tests/cudadrv/test_nvjitlink.py +++ b/numba_cuda/numba/cuda/tests/cudadrv/test_nvjitlink.py @@ -35,7 +35,7 @@ @unittest.skipIf( - not config.ENABLE_PYNVJITLINK or not TEST_BIN_DIR, + not config.CUDA_ENABLE_PYNVJITLINK or not TEST_BIN_DIR, "pynvjitlink not enabled" ) @skip_on_cudasim("Linking unsupported in the simulator")