Skip to content

Commit 521b59d

Browse files
committed
Add specific skip for missing curand_kernel.h
1 parent 1fff276 commit 521b59d

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

numba_cuda/numba/cuda/testing.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,14 @@ def skip_if_cuda_includes_missing(fn):
121121
return unittest.skipUnless(cuda_h_file, reason)(fn)
122122

123123

124+
def skip_if_curand_kernel_missing(fn):
125+
curand_kernel_h = os.path.join(config.CUDA_INCLUDE_PATH, 'curand_kernel.h')
126+
curand_kernel_h_file = (os.path.exists(curand_kernel_h) and
127+
os.path.isfile(curand_kernel_h))
128+
reason = 'curand_kernel.h not available on this system'
129+
return unittest.skipUnless(curand_kernel_h_file, reason)(fn)
130+
131+
124132
def skip_if_mvc_enabled(reason):
125133
"""Skip a test if Minor Version Compatibility is enabled"""
126134
return unittest.skipIf(config.CUDA_ENABLE_MINOR_VERSION_COMPATIBILITY,

numba_cuda/numba/cuda/tests/cudapy/test_device_func.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
import numpy as np
55

6-
from numba.cuda.testing import (skip_if_cuda_includes_missing, skip_on_cudasim,
6+
from numba.cuda.testing import (skip_if_curand_kernel_missing, skip_on_cudasim,
77
test_data_dir, unittest, CUDATestCase)
88
from numba import cuda, jit, float32, int32, types
99
from numba.core.errors import TypingError
@@ -337,7 +337,7 @@ def kernel(x):
337337
expected = np.ones(2, dtype=np.int32)
338338
np.testing.assert_equal(x, expected)
339339

340-
@skip_if_cuda_includes_missing
340+
@skip_if_curand_kernel_missing
341341
def test_include_cuda_header(self):
342342
sig = types.int32(types.uint64)
343343
link = [rng_cu]

0 commit comments

Comments
 (0)