I can change the type to None, and the code runs fine but with warnings.

Python 3.5.1
Loo.py 2016.1.1
PyOpenCL 2016.1.1

For the sake of completeness, I have the entire output listed here.

Device: [<pyopencl.Device 'Intel(R) Iris(TM) Graphics 6100' on 'Apple' at 
0x1024500>]

Traceback (most recent call last):
  File "/Users/sam/anaconda3/lib/python3.5/site-packages/pytools/__init__.py", 
line 472, in wrapper
    return getattr(obj, cache_dict_name)[key]
AttributeError: 'CompiledKernel' object has no attribute 
'_memoize_dic_cl_kernel_info'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/sam/anaconda3/lib/python3.5/site-packages/pytools/__init__.py", 
line 472, in wrapper
    return getattr(obj, cache_dict_name)[key]
AttributeError: 'CompiledKernel' object has no attribute 
'_memoize_dic_get_typed_and_scheduled_kernel'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "pocl.py", line 29, in <module>
    evt, (out,) = knl(queue, a=a)
  File 
"/Users/sam/anaconda3/lib/python3.5/site-packages/loopy/kernel/__init__.py", 
line 1126, in __call__
    queue, **kwargs)
  File "/Users/sam/anaconda3/lib/python3.5/site-packages/loopy/compiled.py", 
line 958, in __call__
    frozenset(six.iteritems(arg_to_dtype)))
  File "/Users/sam/anaconda3/lib/python3.5/site-packages/pytools/__init__.py", 
line 474, in wrapper
    result = function(obj, *args, **kwargs)
  File "/Users/sam/anaconda3/lib/python3.5/site-packages/loopy/compiled.py", 
line 847, in cl_kernel_info
    kernel = self.get_typed_and_scheduled_kernel(arg_to_dtype_set)
  File "/Users/sam/anaconda3/lib/python3.5/site-packages/pytools/__init__.py", 
line 474, in wrapper
    result = function(obj, *args, **kwargs)
  File "/Users/sam/anaconda3/lib/python3.5/site-packages/loopy/compiled.py", 
line 838, in get_typed_and_scheduled_kernel
    kernel = preprocess_kernel(kernel)
  File "/Users/sam/anaconda3/lib/python3.5/site-packages/loopy/preprocess.py", 
line 655, in preprocess_kernel
    result = preprocess_cache[kernel]
  File 
"/Users/sam/anaconda3/lib/python3.5/site-packages/pytools/persistent_dict.py", 
line 421, in __getitem__
    return self.fetch(key)
  File 
"/Users/sam/anaconda3/lib/python3.5/site-packages/pytools/persistent_dict.py", 
line 320, in fetch
    hexdigest_key = self.key_builder(key)
  File 
"/Users/sam/anaconda3/lib/python3.5/site-packages/pytools/persistent_dict.py", 
line 190, in __call__
    self.rec(key_hash, key)
  File 
"/Users/sam/anaconda3/lib/python3.5/site-packages/pytools/persistent_dict.py", 
line 174, in rec
    method(key_hash, self)
  File 
"/Users/sam/anaconda3/lib/python3.5/site-packages/loopy/kernel/__init__.py", 
line 1201, in update_persistent_hash
    key_builder.rec(key_hash, getattr(self, field_name))
  File 
"/Users/sam/anaconda3/lib/python3.5/site-packages/pytools/persistent_dict.py", 
line 174, in rec
    method(key_hash, self)
  File 
"/Users/sam/anaconda3/lib/python3.5/site-packages/loopy/target/__init__.py", 
line 38, in update_persistent_hash
    key_builder.rec(key_hash, getattr(self, field_name))
  File 
"/Users/sam/anaconda3/lib/python3.5/site-packages/pytools/persistent_dict.py", 
line 182, in rec
    method(key_hash, key)
  File 
"/Users/sam/anaconda3/lib/python3.5/site-packages/pytools/persistent_dict.py", 
line 219, in update_for_tuple
    self.rec(key_hash, obj_i)
  File 
"/Users/sam/anaconda3/lib/python3.5/site-packages/pytools/persistent_dict.py", 
line 186, in rec
    % type(key))
TypeError: unsupported type for persistent hash keying: <class 
'pyopencl.cffi_cl.Device’>

> On Jun 19, 2016, at 4:41 PM, Andreas Kloeckner <li...@informa.tiker.net> 
> wrote:
> 
> Hi Sam,
> 
> Samuel Miller <smill...@live.com> writes:
>> I’ve tried to implement the basic example on loo.py’s website with a
>> slight modification but have had some trouble getting it to work
>> right. I tried to add a pyOpenCLTarget for the kernel but it keeps
>> giving me the following error. I’m able to get it to work if I just
>> use an OpenCLTarget, but not with a PyOpenCLTarget. Am I missing
>> something or using loo.py wrong? I’m using Python 3.5 in OS X El
>> Capitan on a Macbook Pro with an Intel Iris 6100. I can include the
>> entire traceback if needed, but it’s about a page’s worth.
> 
> Thanks for the report. What version of loopy do you have? What version
> of Python and PyOpenCL?
> 
> At any rate, it is likely that you may be able to work around this by
> simply passing 'device=None' to the PyOpenCLTarget. This may produce
> some (harmless) warnings.
> 
> Another option would be to use the current git version of loopy, where I
> can't reproduce this issue (to be released fairly soon).
> 
> Hope that helps,
> Andreas

_______________________________________________
PyOpenCL mailing list
PyOpenCL@tiker.net
https://lists.tiker.net/listinfo/pyopencl

Reply via email to