Skip to content
Snippets Groups Projects
Commit df7dbba8 authored by Andreas Klöckner's avatar Andreas Klöckner
Browse files

Find sensible default for whether to allow complex-valued variables.

parent 0ff6e477
No related branches found
No related tags found
No related merge requests found
......@@ -188,7 +188,7 @@ class POD(PODBase):
# {{{ main code generation entrypoint
def generate_code(kernel, with_annotation=False,
allow_complex=False):
allow_complex=None):
from cgen import (FunctionBody, FunctionDeclaration,
Value, ArrayOf, Module, Block,
Line, Const, LiteralLines, Initializer)
......@@ -196,6 +196,11 @@ def generate_code(kernel, with_annotation=False,
from cgen.opencl import (CLKernel, CLGlobal, CLRequiredWorkGroupSize,
CLLocal, CLImage, CLConstant)
allow_complex = False
for var in kernel.args + list(kernel.temporary_variables.itervalues()):
if var.dtype.kind == "c":
allow_complex = True
from loopy.codegen.expression import LoopyCCodeMapper
ccm = (LoopyCCodeMapper(kernel, with_annotation=with_annotation,
allow_complex=allow_complex)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment