Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ If you want to manage all run-time dependencies yourself, also pass the `--no-de
## Running tests

```
python -m numba.runtests numba.cuda.tests
pytest --pyargs numba.cuda.tests -v
```

This should discover the `numba.cuda` module from the `numba_cuda` package. You
Expand Down
2 changes: 1 addition & 1 deletion ci/test_conda.sh
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ fi


rapids-logger "Run Tests"
python -m numba.runtests numba.cuda.tests -v
pytest --pyargs numba.cuda.tests -v

popd

Expand Down
2 changes: 1 addition & 1 deletion ci/test_conda_ctypes_binding.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ popd


rapids-logger "Run Tests"
NUMBA_CUDA_USE_NVIDIA_BINDING=0 NUMBA_CUDA_TEST_BIN_DIR=$NUMBA_CUDA_TEST_BIN_DIR python -m numba.runtests numba.cuda.tests -v
NUMBA_CUDA_USE_NVIDIA_BINDING=0 NUMBA_CUDA_TEST_BIN_DIR=$NUMBA_CUDA_TEST_BIN_DIR pytest --pyargs numba.cuda.tests -v

popd

Expand Down
2 changes: 1 addition & 1 deletion ci/test_simulator.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ set +e

rapids-logger "Run Tests"
export NUMBA_ENABLE_CUDASIM=1
python -m numba.runtests numba.cuda.tests -v
pytest --pyargs numba.cuda.tests -v

popd

Expand Down
2 changes: 1 addition & 1 deletion ci/test_wheel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,6 @@ rapids-logger "Show Numba system info"
python -m numba --sysinfo

rapids-logger "Run Tests"
python -m numba.runtests numba.cuda.tests -v
python -m pytest --pyargs numba.cuda.tests -v

popd
2 changes: 1 addition & 1 deletion ci/test_wheel_ctypes_binding.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,6 @@ rapids-logger "Show Numba system info"
NUMBA_CUDA_USE_NVIDIA_BINDING=0 python -m numba --sysinfo

rapids-logger "Run Tests"
NUMBA_CUDA_USE_NVIDIA_BINDING=0 NUMBA_CUDA_TEST_BIN_DIR=$NUMBA_CUDA_TEST_BIN_DIR python -m numba.runtests numba.cuda.tests -v
NUMBA_CUDA_USE_NVIDIA_BINDING=0 NUMBA_CUDA_TEST_BIN_DIR=$NUMBA_CUDA_TEST_BIN_DIR python -m pytest --pyargs numba.cuda.tests -v

popd
2 changes: 1 addition & 1 deletion ci/test_wheel_deps_wheels.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,6 @@ apt remove --purge `dpkg --get-selections | grep cuda-nvvm | awk '{print $1}'` -
apt remove --purge `dpkg --get-selections | grep cuda-nvrtc | awk '{print $1}'` -y

rapids-logger "Run Tests"
NUMBA_CUDA_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 pytest --pyargs numba.cuda.tests -v

popd
2 changes: 1 addition & 1 deletion docs/source/user/external-memory.rst
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ Numba test suite with an EMM Plugin, e.g.:

.. code::

$ NUMBA_CUDA_MEMORY_MANAGER=rmm python -m numba.runtests numba.cuda.tests
$ NUMBA_CUDA_MEMORY_MANAGER=rmm pytest --pyargs numba.cuda.tests -v


Function
Expand Down
8 changes: 0 additions & 8 deletions numba_cuda/numba/cuda/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import importlib
from numba import runtests
from numba.core import config
from .utils import _readenv
import warnings
Expand Down Expand Up @@ -94,10 +93,3 @@

if numba_cuda_default_ptx_cc > config_default_cc:
config.CUDA_DEFAULT_PTX_CC = numba_cuda_default_ptx_cc


def test(*args, **kwargs):
if not is_available():
raise cuda_error()

return runtests.main("numba.cuda.tests", *args, **kwargs)
20 changes: 10 additions & 10 deletions numba_cuda/numba/cuda/tests/cudapy/test_intrinsics.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,27 +174,27 @@ def hlt_func_2(x, y):
return cuda.fp16.hlt(x, y)


def test_multiple_hcmp_1(r, a, b, c):
def multiple_hcmp_1(r, a, b, c):
# float16 predicates used in two separate functions
r[0] = hlt_func_1(a, b) and hlt_func_2(b, c)


def test_multiple_hcmp_2(r, a, b, c):
def multiple_hcmp_2(r, a, b, c):
# The same float16 predicate used in the caller and callee
r[0] = hlt_func_1(a, b) and cuda.fp16.hlt(b, c)


def test_multiple_hcmp_3(r, a, b, c):
def multiple_hcmp_3(r, a, b, c):
# Different float16 predicates used in the caller and callee
r[0] = hlt_func_1(a, b) and cuda.fp16.hge(c, b)


def test_multiple_hcmp_4(r, a, b, c):
def multiple_hcmp_4(r, a, b, c):
# The same float16 predicates used twice in a function
r[0] = cuda.fp16.hlt(a, b) and cuda.fp16.hlt(b, c)


def test_multiple_hcmp_5(r, a, b, c):
def multiple_hcmp_5(r, a, b, c):
# Different float16 predicates used in a function
r[0] = cuda.fp16.hlt(a, b) and cuda.fp16.hge(c, b)

Expand Down Expand Up @@ -908,11 +908,11 @@ def test_fp16_comparison(self):
@skip_unless_cc_53
def test_multiple_float16_comparisons(self):
functions = (
test_multiple_hcmp_1,
test_multiple_hcmp_2,
test_multiple_hcmp_3,
test_multiple_hcmp_4,
test_multiple_hcmp_5,
multiple_hcmp_1,
multiple_hcmp_2,
multiple_hcmp_3,
multiple_hcmp_4,
multiple_hcmp_5,
)
for fn in functions:
with self.subTest(fn=fn):
Expand Down
30 changes: 15 additions & 15 deletions numba_cuda/numba/cuda/tests/cudapy/test_operator.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,27 +87,27 @@ def hlt_func_2(x, y):
return x < y


def test_multiple_hcmp_1(r, a, b, c):
def multiple_hcmp_1(r, a, b, c):
# float16 predicates used in two separate functions
r[0] = hlt_func_1(a, b) and hlt_func_2(b, c)


def test_multiple_hcmp_2(r, a, b, c):
def multiple_hcmp_2(r, a, b, c):
# The same float16 predicate used in the caller and callee
r[0] = hlt_func_1(a, b) and b < c


def test_multiple_hcmp_3(r, a, b, c):
def multiple_hcmp_3(r, a, b, c):
# Different float16 predicates used in the caller and callee
r[0] = hlt_func_1(a, b) and c >= b


def test_multiple_hcmp_4(r, a, b, c):
def multiple_hcmp_4(r, a, b, c):
# The same float16 predicates used twice in a function
r[0] = a < b and b < c


def test_multiple_hcmp_5(r, a, b, c):
def multiple_hcmp_5(r, a, b, c):
# Different float16 predicates used in a function
r[0] = a < b and c >= b

Expand Down Expand Up @@ -331,11 +331,11 @@ def test_mixed_fp16_comparison(self):
@skip_unless_cc_53
def test_multiple_float16_comparisons(self):
functions = (
test_multiple_hcmp_1,
test_multiple_hcmp_2,
test_multiple_hcmp_3,
test_multiple_hcmp_4,
test_multiple_hcmp_5,
multiple_hcmp_1,
multiple_hcmp_2,
multiple_hcmp_3,
multiple_hcmp_4,
multiple_hcmp_5,
)
for fn in functions:
with self.subTest(fn=fn):
Expand All @@ -350,11 +350,11 @@ def test_multiple_float16_comparisons(self):
@skip_unless_cc_53
def test_multiple_float16_comparisons_false(self):
functions = (
test_multiple_hcmp_1,
test_multiple_hcmp_2,
test_multiple_hcmp_3,
test_multiple_hcmp_4,
test_multiple_hcmp_5,
multiple_hcmp_1,
multiple_hcmp_2,
multiple_hcmp_3,
multiple_hcmp_4,
multiple_hcmp_5,
)
for fn in functions:
with self.subTest(fn=fn):
Expand Down
5 changes: 5 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,11 @@ include = ["numba_cuda*"]
[tool.setuptools.package-data]
"*" = ["*.cu", "*.h", "*.hpp", "*.ptx", "*.cuh", "VERSION", "Makefile"]

[tool.pytest.ini_options]
minversion = "8.0"
testpaths = ["numba_cuda/numba/cuda/tests"]
consider_namespace_packages = true

[tool.ruff]
line-length = 80

Expand Down