loopy doesn't infer type for plain int ValueArg
import loopy as lp
import numpy as np
knl = lp.make_kernel("{[i]: 0 <= i < 10}", "", [lp.GlobalArg("a", np.float32, shape=("n",)), lp.ValueArg("n")])
import pyopencl as cl
c = cl._csc()
q = cl.CommandQueue(c)
knl(q, a=np.array([1.,2.,3.]), n=3)
results in
Traceback (most recent call last):
File "/home/matt/src/env-3.4/lib/python3.4/site-packages/pytools-2016.2.6-py3.4.egg/pytools/__init__.py", line 486, in wrapper
return getattr(obj, cache_dict_name)[key]
AttributeError: 'PyOpenCLKernelExecutor' object has no attribute '_memoize_dic_cl_kernel_info'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/matt/src/loopy/loopy/kernel/__init__.py", line 1327, in __call__
return kex(*args, **kwargs)
File "/home/matt/src/loopy/loopy/target/pyopencl_execution.py", line 737, in __call__
kernel_info = self.cl_kernel_info(self.arg_to_dtype_set(kwargs))
File "/home/matt/src/env-3.4/lib/python3.4/site-packages/pytools-2016.2.6-py3.4.egg/pytools/__init__.py", line 488, in wrapper
result = function(obj, *args, **kwargs)
File "/home/matt/src/loopy/loopy/target/pyopencl_execution.py", line 651, in cl_kernel_info
codegen_result = generate_code_v2(kernel)
File "/home/matt/src/loopy/loopy/codegen/__init__.py", line 409, in generate_code_v2
kernel = infer_unknown_types(kernel, expect_completion=True)
File "/home/matt/src/loopy/loopy/type_inference.py", line 580, in infer_unknown_types
% (item.name, advice))
loopy.diagnostic.LoopyError: could not determine type of 'n'