Skip to content

Commit

Permalink
Enqueue code generation: handle empty arg lists
Browse files Browse the repository at this point in the history
  • Loading branch information
inducer committed Jul 5, 2015
1 parent 61f7b27 commit f20eeb5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pyopencl/__init__.py
Expand Up @@ -755,6 +755,9 @@ def kernel__generate_naive_call(self):
from pytools.py_codegen import PythonCodeGenerator
gen = PythonCodeGenerator()

if num_args == 0:
gen("pass")

for i in range(num_args):
gen("# process argument {arg_idx}".format(arg_idx=i))
gen("")
Expand Down Expand Up @@ -793,6 +796,9 @@ def kernel_set_scalar_arg_dtypes(self, scalar_arg_dtypes):
from pytools.py_codegen import PythonCodeGenerator
gen = PythonCodeGenerator()

if not scalar_arg_dtypes:
gen("pass")

for arg_idx, arg_dtype in enumerate(scalar_arg_dtypes):
gen("# process argument {arg_idx}".format(arg_idx=arg_idx))
gen("")
Expand Down

0 comments on commit f20eeb5

Please sign in to comment.