diff --git a/test/cuda/test_api.py b/test/cuda/test_api.py deleted file mode 100644 index f1c4a5a..0000000 --- a/test/cuda/test_api.py +++ /dev/null @@ -1,11 +0,0 @@ -from pathlib import Path - -import ffcx.main - - -def test_cuda_backend() -> None: - """Test CUDA backend.""" - - opts = "--language ffcx_backends.cuda --scalar_type float64" - directory = Path(__file__).parent.parent - assert ffcx.main.main([str(directory / "poisson.py"), *opts.split(" ")]) == 0 diff --git a/test/cuda/test_nvrtc.py b/test/cuda/test_cuda.py similarity index 70% rename from test/cuda/test_nvrtc.py rename to test/cuda/test_cuda.py index 1c4588e..e563427 100644 --- a/test/cuda/test_nvrtc.py +++ b/test/cuda/test_cuda.py @@ -1,6 +1,7 @@ import subprocess from pathlib import Path +import ffcx.main import pytest pytest.importorskip("nvidia.cuda_nvrtc", reason="NVRTC not available on all platforms.") @@ -47,7 +48,7 @@ def test_compiler_arg_count(nvrtc_compiler: None) -> None: assert "Usage:" in str(error.value) -def test_demo_nvrtc(nvrtc_compiler: None) -> None: +def test_sample_integral(nvrtc_compiler: None) -> None: cuda = Path(__file__).parent build = cuda / "nvrtc_compiler" / "build" source = cuda / "sample_integral.cu" @@ -56,3 +57,16 @@ def test_demo_nvrtc(nvrtc_compiler: None) -> None: ["./nvrtc_compiler", source], cwd=build, ) + + +@pytest.mark.parametrize("dtype", ["float32", "float64"]) +def test_poisson(nvrtc_compiler: None, dtype: str) -> None: + opts = f"--language ffcx_backends.cuda --scalar_type {dtype}" + directory = Path(__file__).parent.parent + assert ffcx.main.main([str(directory / "poisson.py"), *opts.split(" ")]) == 0 + + cuda = Path(__file__).parent + build = cuda / "nvrtc_compiler" / "build" + source = cuda / "sample_integral.cu" + + subprocess.check_call([build / "nvrtc_compiler", source], cwd=build) diff --git a/test/test_placeholder.py b/test/test_placeholder.py deleted file mode 100644 index 5461e16..0000000 --- a/test/test_placeholder.py +++ /dev/null @@ -1,6 +0,0 @@ -import importlib - - -def test() -> None: - importlib.import_module("ffcx_backends") - assert True