diff --git a/loopy/codegen/__init__.py b/loopy/codegen/__init__.py index e8f7ec61cc1b759dc4eef6b79b0f6eb57f8f20d7..62977a48485e51c881cb087c06757577956e4461 100644 --- a/loopy/codegen/__init__.py +++ b/loopy/codegen/__init__.py @@ -174,11 +174,22 @@ def make_initial_assignments(kernel): # }}} +# {{{ cgen overrides + +from cgen import POD as PODBase + +class POD(PODBase): + def get_decl_pair(self): + from pyopencl.tools import dtype_to_ctype + return [dtype_to_ctype(self.dtype)], self.name + +# }}} + # {{{ main code generation entrypoint def generate_code(kernel, with_annotation=False): from cgen import (FunctionBody, FunctionDeclaration, - POD, Value, ArrayOf, Module, Block, + Value, ArrayOf, Module, Block, Line, Const, LiteralLines, Initializer) from cgen.opencl import (CLKernel, CLGlobal, CLRequiredWorkGroupSize, @@ -335,4 +346,5 @@ def generate_code(kernel, with_annotation=False): + # vim: foldmethod=marker