diff --git a/loopy/target/pyopencl.py b/loopy/target/pyopencl.py index f9b37b53f6cbedc22bb319952bb05357ef980b54..59b72ac68388f190736c001c99cd69a3e8560ccb 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):