From f244fad43115b788e0ac2be0f5a7b47bf609a6f7 Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner Date: Sun, 30 May 2021 17:36:23 -0500 Subject: [PATCH] Drop PyOpenCL legacy type registry stub --- loopy/target/pyopencl.py | 33 ++++++--------------------------- 1 file changed, 6 insertions(+), 27 deletions(-) diff --git a/loopy/target/pyopencl.py b/loopy/target/pyopencl.py index f9b37b53f..59b72ac68 100644 --- a/loopy/target/pyopencl.py +++ b/loopy/target/pyopencl.py @@ -256,22 +256,6 @@ def pyopencl_preamble_generator(preamble_info): # }}} -# {{{ pyopencl tools - -class _LegacyTypeRegistryStub: - """Adapts legacy PyOpenCL type registry to be usable with PyOpenCLTarget.""" - - def get_or_register_dtype(self, names, dtype=None): - from pyopencl.compyte.dtypes import get_or_register_dtype - return get_or_register_dtype(names, dtype) - - def dtype_to_ctype(self, dtype): - from pyopencl.compyte.dtypes import dtype_to_ctype - return dtype_to_ctype(dtype) - -# }}} - - # {{{ expression mapper class ExpressionToPyOpenCLCExpressionMapper(ExpressionToOpenCLCExpressionMapper): @@ -581,24 +565,19 @@ class PyOpenCLTarget(OpenCLTarget): # {{{ types def get_dtype_registry(self): - try: - from pyopencl.compyte.dtypes import TYPE_REGISTRY - except ImportError: - result = _LegacyTypeRegistryStub() - else: - result = TYPE_REGISTRY + from pyopencl.compyte.dtypes import TYPE_REGISTRY + result = TYPE_REGISTRY - from loopy.target.opencl import (DTypeRegistryWrapperWithCL1Atomics, - DTypeRegistryWrapperWithInt8ForBool) + from loopy.target.opencl import ( + DTypeRegistryWrapperWithCL1Atomics, + DTypeRegistryWrapperWithInt8ForBool) + result = DTypeRegistryWrapperWithInt8ForBool(result) if self.atomics_flavor == "cl1": result = DTypeRegistryWrapperWithCL1Atomics(result) else: raise NotImplementedError("atomics flavor: %s" % self.atomics_flavor) - if self.use_int8_for_bool: - result = DTypeRegistryWrapperWithInt8ForBool(result) - return result def is_vector_dtype(self, dtype): -- GitLab