From 98cdc5a611b92c723bd780ccfdc8a805172c7e63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20T=2E=20K=C3=BChner?= <56360279+schnellerhase@users.noreply.github.com> Date: Tue, 31 Mar 2026 17:44:36 +0000 Subject: [PATCH 1/2] Remove placeholder test --- test/test_placeholder.py | 6 ------ 1 file changed, 6 deletions(-) delete mode 100644 test/test_placeholder.py 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 From 0b3db8c982d8142fbb1aeafc43564d6b7de5ddcf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20T=2E=20K=C3=BChner?= <56360279+schnellerhase@users.noreply.github.com> Date: Mon, 30 Mar 2026 16:17:47 +0000 Subject: [PATCH 2/2] Add nvrtc compile test --- test/cuda/test_api.py | 11 ----------- test/cuda/{test_nvrtc.py => test_cuda.py} | 16 +++++++++++++++- 2 files changed, 15 insertions(+), 12 deletions(-) delete mode 100644 test/cuda/test_api.py rename test/cuda/{test_nvrtc.py => test_cuda.py} (70%) 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)