From fc8bd950804e78417ded6153dc7a99d6d527bcb8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20T=2E=20K=C3=BChner?= <56360279+schnellerhase@users.noreply.github.com> Date: Fri, 3 Jul 2026 11:27:17 +0200 Subject: [PATCH 1/3] Remove unused type ignores --- ffcx_backends/cuda/jit.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ffcx_backends/cuda/jit.py b/ffcx_backends/cuda/jit.py index a13b683..e3761d7 100644 --- a/ffcx_backends/cuda/jit.py +++ b/ffcx_backends/cuda/jit.py @@ -208,7 +208,7 @@ def compile_forms( try: decl = ( - UFC_HEADER_DECL.format(np.dtype(p["scalar_type"]).name) # type: ignore + UFC_HEADER_DECL.format(np.dtype(p["scalar_type"]).name) + UFC_INTEGRAL_DECL + UFC_FORM_DECL ) @@ -303,7 +303,7 @@ def compile_expressions( try: decl = ( - UFC_HEADER_DECL.format(np.dtype(p["scalar_type"]).name) # type: ignore + UFC_HEADER_DECL.format(np.dtype(p["scalar_type"]).name) + UFC_INTEGRAL_DECL + UFC_FORM_DECL + UFC_EXPRESSION_DECL From c871487fd9997c0215fb67a83c61dd5aaf8fa317 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20T=2E=20K=C3=BChner?= <56360279+schnellerhase@users.noreply.github.com> Date: Sat, 4 Jul 2026 10:43:15 +0200 Subject: [PATCH 2/3] Fix: missing import --- ffcx_backends/cuda/jit.py | 1 + 1 file changed, 1 insertion(+) diff --git a/ffcx_backends/cuda/jit.py b/ffcx_backends/cuda/jit.py index e3761d7..be58d97 100644 --- a/ffcx_backends/cuda/jit.py +++ b/ffcx_backends/cuda/jit.py @@ -16,6 +16,7 @@ import cffi import ffcx +import ffcx.codegeneration import ffcx.naming import numpy as np import numpy.typing as npt From c59925b09cce07d52b5bc892ec6e4bd99aa38f50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20T=2E=20K=C3=BChner?= <56360279+schnellerhase@users.noreply.github.com> Date: Sat, 4 Jul 2026 10:48:51 +0200 Subject: [PATCH 3/3] Fix: type deduction --- ffcx_backends/cuda/jit.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/ffcx_backends/cuda/jit.py b/ffcx_backends/cuda/jit.py index be58d97..075c0a8 100644 --- a/ffcx_backends/cuda/jit.py +++ b/ffcx_backends/cuda/jit.py @@ -207,11 +207,12 @@ def compile_forms( else: cache_dir = Path(tempfile.mkdtemp()) + scalar_type = p["scalar_type"] + assert isinstance(scalar_type, str) + try: decl = ( - UFC_HEADER_DECL.format(np.dtype(p["scalar_type"]).name) - + UFC_INTEGRAL_DECL - + UFC_FORM_DECL + UFC_HEADER_DECL.format(np.dtype(scalar_type).name) + UFC_INTEGRAL_DECL + UFC_FORM_DECL ) form_template = "extern ufcx_form {name};\n" @@ -302,9 +303,12 @@ def compile_expressions( else: cache_dir = Path(tempfile.mkdtemp()) + scalar_type = p["scalar_type"] + assert isinstance(scalar_type, str) + try: decl = ( - UFC_HEADER_DECL.format(np.dtype(p["scalar_type"]).name) + UFC_HEADER_DECL.format(np.dtype(scalar_type).name) + UFC_INTEGRAL_DECL + UFC_FORM_DECL + UFC_EXPRESSION_DECL