From abfa7d64e103be72b73352a65d416bc2c595cc72 Mon Sep 17 00:00:00 2001 From: Stephan Seitz <stephan.seitz@fau.de> Date: Tue, 13 Aug 2019 17:59:58 +0200 Subject: [PATCH] Avoid CUDA intrinsics in OpenCL / Mark some methods as not implemented --- pystencils/backends/opencl_backend.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/pystencils/backends/opencl_backend.py b/pystencils/backends/opencl_backend.py index ac8a7a78f..55af4a6bd 100644 --- a/pystencils/backends/opencl_backend.py +++ b/pystencils/backends/opencl_backend.py @@ -1,6 +1,6 @@ import pystencils.data_types from pystencils.astnodes import Node -from pystencils.backends.cbackend import generate_c +from pystencils.backends.cbackend import CustomSympyPrinter, generate_c from pystencils.backends.cuda_backend import CudaBackend, CudaSympyPrinter @@ -35,6 +35,12 @@ class OpenClBackend(CudaBackend): else: return code + def _print_ThreadBlockSynchronization(self, node): + raise NotImplementedError() + + def _print_TextureDeclaration(self, node): + raise NotImplementedError() + class OpenClSympyPrinter(CudaSympyPrinter): language = "OpenCL" @@ -57,3 +63,9 @@ class OpenClSympyPrinter(CudaSympyPrinter): dimension = self.DIMENSION_MAPPING[dimension] function_name = self.INDEXING_FUNCTION_MAPPING[function_name] return f"{function_name}({dimension})" + + def _print_TextureAccess(self, node): + raise NotImplementedError() + + # Avoid usage of CUDA intrinsics + _print_Function = CustomSympyPrinter._print_Function -- GitLab