From a9bf2c52ff3d1d3e39d9c6e75b7f7d8ca1fdd009 Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner <inform@tiker.net> Date: Tue, 29 Mar 2016 10:43:49 -0500 Subject: [PATCH] Annotate vector dtypes with target Among other things, this ensures that impl_arg_info is picklable. --- loopy/target/cuda.py | 4 +++- loopy/target/opencl.py | 4 +++- loopy/target/pyopencl.py | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/loopy/target/cuda.py b/loopy/target/cuda.py index 89d090b7a..6d3833a5c 100644 --- a/loopy/target/cuda.py +++ b/loopy/target/cuda.py @@ -206,7 +206,9 @@ class CudaTarget(CTarget): and dtype.numpy_dtype in list(vec.types.values())) def vector_dtype(self, base, count): - return NumpyType(vec.types[base.numpy_dtype, count]) + return NumpyType( + vec.types[base.numpy_dtype, count], + target=self) # }}} diff --git a/loopy/target/opencl.py b/loopy/target/opencl.py index 70bce2331..e9054470f 100644 --- a/loopy/target/opencl.py +++ b/loopy/target/opencl.py @@ -293,7 +293,9 @@ class OpenCLTarget(CTarget): and dtype.numpy_dtype in list(vec.types.values())) def vector_dtype(self, base, count): - return NumpyType(vec.types[base.numpy_dtype, count]) + return NumpyType( + vec.types[base.numpy_dtype, count], + target=self) # }}} diff --git a/loopy/target/pyopencl.py b/loopy/target/pyopencl.py index add5bd9e2..aea247397 100644 --- a/loopy/target/pyopencl.py +++ b/loopy/target/pyopencl.py @@ -307,7 +307,9 @@ class PyOpenCLTarget(OpenCLTarget): def vector_dtype(self, base, count): from pyopencl.array import vec - return NumpyType(vec.types[base.numpy_dtype, count]) + return NumpyType( + vec.types[base.numpy_dtype, count], + target=self) def alignment_requirement(self, type_decl): import struct -- GitLab