diff --git a/src/pystencils/backend/platforms/cuda.py b/src/pystencils/backend/platforms/cuda.py index b8f5356ae7bbdb961773e122e2d6d377f0f7e45f..f146cfbfd3d3d4f106bc82571bd613798644f241 100644 --- a/src/pystencils/backend/platforms/cuda.py +++ b/src/pystencils/backend/platforms/cuda.py @@ -122,6 +122,11 @@ class CudaPlatform(GenericGpu): case MathFunctions.Abs if dtype.width == 16: cfunc = CFunction(" __habs", arg_types, dtype) + case _: + raise MaterializationError( + f"Cannot materialize call to function {func}" + ) + call.function = cfunc return call diff --git a/src/pystencils/backend/platforms/generic_gpu.py b/src/pystencils/backend/platforms/generic_gpu.py index da8fa64f9f6d9e8de08b84bc169ae2442d0dec42..15df36cdd9cf416a8438f12816cbe00cfaeea204 100644 --- a/src/pystencils/backend/platforms/generic_gpu.py +++ b/src/pystencils/backend/platforms/generic_gpu.py @@ -19,7 +19,7 @@ if TYPE_CHECKING: class GenericGpu(Platform): @abstractmethod def materialize_iteration_space( - self, block: PsBlock, ispace: IterationSpace + self, body: PsBlock, ispace: IterationSpace ) -> tuple[PsBlock, GpuThreadsRange | None]: pass diff --git a/src/pystencils/backend/platforms/platform.py b/src/pystencils/backend/platforms/platform.py index cab4d0a7b0143eabd4e40602b45ef2f66592ee8c..2c7ee1c5f4750eac0375bc31a3f44b9eea50642b 100644 --- a/src/pystencils/backend/platforms/platform.py +++ b/src/pystencils/backend/platforms/platform.py @@ -27,7 +27,7 @@ class Platform(ABC): @abstractmethod def materialize_iteration_space( - self, block: PsBlock, ispace: IterationSpace + self, body: PsBlock, ispace: IterationSpace ) -> PsBlock | tuple[PsBlock, Any]: pass diff --git a/tests/kernelcreation/test_functions.py b/tests/kernelcreation/test_functions.py index e16201f819161fc611ec16b09dc98a7d7abf9445..cab1affcb3a344033458829ba28765a9a1ff8c48 100644 --- a/tests/kernelcreation/test_functions.py +++ b/tests/kernelcreation/test_functions.py @@ -7,7 +7,6 @@ from pystencils.backend.ast import dfs_preorder from pystencils.backend.ast.expressions import PsCall - def unary_function(name, xp): return { "exp": (sp.exp, xp.exp), diff --git a/tests/kernelcreation/test_iteration_slices.py b/tests/kernelcreation/test_iteration_slices.py index 47f3b5fac2b868df746469f2d1a5c5aabdc12172..fee3544f88087917290a42ed76d8941577726759 100644 --- a/tests/kernelcreation/test_iteration_slices.py +++ b/tests/kernelcreation/test_iteration_slices.py @@ -62,6 +62,8 @@ def test_sliced_iteration(): make_slice[3, 2:-2], make_slice[2:-2:2, ::3], make_slice[10:, :-5:2], + make_slice[-5:-1, -1], + make_slice[-3, -1] ], ) def test_numerical_slices(gen_config: CreateKernelConfig, xp, islice):