Skip to content

Commit

Permalink
Add specific skip for missing curand_kernel.h
Browse files Browse the repository at this point in the history
  • Loading branch information
gmarkall committed Feb 18, 2025
1 parent 1fff276 commit 521b59d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
8 changes: 8 additions & 0 deletions numba_cuda/numba/cuda/testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,14 @@ def skip_if_cuda_includes_missing(fn):
return unittest.skipUnless(cuda_h_file, reason)(fn)


def skip_if_curand_kernel_missing(fn):
curand_kernel_h = os.path.join(config.CUDA_INCLUDE_PATH, 'curand_kernel.h')
curand_kernel_h_file = (os.path.exists(curand_kernel_h) and
os.path.isfile(curand_kernel_h))
reason = 'curand_kernel.h not available on this system'
return unittest.skipUnless(curand_kernel_h_file, reason)(fn)


def skip_if_mvc_enabled(reason):
"""Skip a test if Minor Version Compatibility is enabled"""
return unittest.skipIf(config.CUDA_ENABLE_MINOR_VERSION_COMPATIBILITY,
Expand Down
4 changes: 2 additions & 2 deletions numba_cuda/numba/cuda/tests/cudapy/test_device_func.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import numpy as np

from numba.cuda.testing import (skip_if_cuda_includes_missing, skip_on_cudasim,
from numba.cuda.testing import (skip_if_curand_kernel_missing, skip_on_cudasim,
test_data_dir, unittest, CUDATestCase)
from numba import cuda, jit, float32, int32, types
from numba.core.errors import TypingError
Expand Down Expand Up @@ -337,7 +337,7 @@ def kernel(x):
expected = np.ones(2, dtype=np.int32)
np.testing.assert_equal(x, expected)

@skip_if_cuda_includes_missing
@skip_if_curand_kernel_missing
def test_include_cuda_header(self):
sig = types.int32(types.uint64)
link = [rng_cu]
Expand Down

0 comments on commit 521b59d

Please sign in to comment.