Skip to content

Commit

Permalink
Skip GPU tests if cupy and numba not installed
Browse files Browse the repository at this point in the history
See issue #50
  • Loading branch information
tberlok committed Feb 29, 2024
1 parent 7a356a7 commit 0eba077
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 6 deletions.
7 changes: 1 addition & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ checks:
cd tests; pytest comoving
cd tests; pytest non-comoving
cd tests; pytest general
cd tests; pytest cuda-gpu

linting:
flake8 ./
Expand All @@ -29,9 +30,3 @@ linting:
dev_checks:
make checks
make linting

# Tests that can only run on some systems
gpu_checks:
cd tests; python cuda-gpu/test_gpu_binary_tree.py
cd tests; python cuda-gpu/test_gpu_ray_projector.py
cd tests; python cuda-gpu/test_gpu_sph_projector.py
5 changes: 5 additions & 0 deletions tests/cuda-gpu/test_gpu_binary_tree.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
import pytest

cupy = pytest.importorskip("cupy")
numba = pytest.importorskip("numba")


def test_gpu_binary_tree():
import cupy as cp
Expand Down
6 changes: 6 additions & 0 deletions tests/cuda-gpu/test_gpu_ray_projector.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
import pytest

cupy = pytest.importorskip("cupy")
numba = pytest.importorskip("numba")


def test_gpu_ray_projector(show=False):
"""
We compare the CPU and GPU implementations of ray-tracing.
Expand Down
6 changes: 6 additions & 0 deletions tests/cuda-gpu/test_gpu_sph_projector.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
import pytest

cupy = pytest.importorskip("cupy")
numba = pytest.importorskip("numba")


def test_gpu_sph_projector(show=False):
"""
We compare the CPU and GPU implementations of SPH-projection.
Expand Down

0 comments on commit 0eba077

Please sign in to comment.