From 243e3f1434890b90dbc07946aa22cb5d7cb4fb0d Mon Sep 17 00:00:00 2001 From: Markus Holzer <markus.holzer@fau.de> Date: Mon, 22 Nov 2021 14:16:03 +0100 Subject: [PATCH] next try --- pystencils/backends/cbackend.py | 2 +- pystencils/kernelcreation.py | 2 -- pystencils/rng.py | 3 +-- pystencils_tests/test_create_kernel_config.py | 3 --- pystencils_tests/test_datahandling.py | 2 +- 5 files changed, 3 insertions(+), 9 deletions(-) diff --git a/pystencils/backends/cbackend.py b/pystencils/backends/cbackend.py index 335449a4..a17ee726 100644 --- a/pystencils/backends/cbackend.py +++ b/pystencils/backends/cbackend.py @@ -47,7 +47,7 @@ def generate_c(ast_node: Node, Args: ast_node: ast representation of kernel signature_only: generate signature without function body - dialect: `Backend`: 'C', 'CUDA' or 'OPENCL' + dialect: `Backend`: 'C' or 'CUDA' custom_backend: use own custom printer for code generation with_globals: enable usage of global variables Returns: diff --git a/pystencils/kernelcreation.py b/pystencils/kernelcreation.py index c4f22de7..98095151 100644 --- a/pystencils/kernelcreation.py +++ b/pystencils/kernelcreation.py @@ -127,8 +127,6 @@ class CreateKernelConfig: self.backend = Backend.C elif self.target == Target.GPU: self.backend = Backend.CUDA - elif self.target == Target.OPENCL: - self.backend = Backend.OPENCL else: raise NotImplementedError(f'Target {self.target} has no default backend') diff --git a/pystencils/rng.py b/pystencils/rng.py index 513792a9..863867bf 100644 --- a/pystencils/rng.py +++ b/pystencils/rng.py @@ -54,8 +54,7 @@ class RNGBase(CustomCodeNode): else: code += f"{vector_instruction_set[r.dtype.base_name] if vector_instruction_set else r.dtype} " + \ f"{r.name};\n" - args = [print_arg(a) for a in self.args] + \ - [('&' if dialect == Backend.OPENCL else '') + r.name for r in self.result_symbols] + args = [print_arg(a) for a in self.args] + ['' + r.name for r in self.result_symbols] code += (self._name + "(" + ", ".join(args) + ");\n") return code diff --git a/pystencils_tests/test_create_kernel_config.py b/pystencils_tests/test_create_kernel_config.py index 836569a9..86a1c0ca 100644 --- a/pystencils_tests/test_create_kernel_config.py +++ b/pystencils_tests/test_create_kernel_config.py @@ -10,9 +10,6 @@ def test_create_kernel_config(): c = ps.CreateKernelConfig(target=ps.Target.GPU) assert c.backend == ps.Backend.CUDA - c = ps.CreateKernelConfig(target=ps.Target.OPENCL) - assert c.backend == ps.Backend.OPENCL - c = ps.CreateKernelConfig(backend=ps.Backend.CUDA) assert c.target == ps.Target.CPU assert c.backend == ps.Backend.CUDA diff --git a/pystencils_tests/test_datahandling.py b/pystencils_tests/test_datahandling.py index 2a7fe233..f160f5f5 100644 --- a/pystencils_tests/test_datahandling.py +++ b/pystencils_tests/test_datahandling.py @@ -116,7 +116,7 @@ def synchronization(dh, test_gpu=False): def kernel_execution_jacobi(dh, target): - test_gpu = target == Target.GPU or target == Target.OPENCL + test_gpu = target == Target.GPU dh.add_array('f', gpu=test_gpu) dh.add_array('tmp', gpu=test_gpu) -- GitLab