fjarri / reikna

Pure Python GPGPU library
http://reikna.publicfields.net/
MIT License
164 stars 16 forks source link

SyntaxError #30

Closed Chakazul closed 6 years ago

Chakazul commented 6 years ago

SyntaxError occurs when calling reikna.cluda.any_api() in Windows 10 (PyOpenCL and Reikna installed). The same code has no problem in MacBookPro.

Traceback (most recent call last):
  File "Lenia.py", line 307, in compile_gpu
    self.gpu_api = reikna.cluda.any_api()
  File "C:\Users\a\AppData\Local\Programs\Python\Python37-32\lib\site-packages\reikna\cluda\api_discovery.py", line 75, in any_api
    api_ids = supported_api_ids()
  File "C:\Users\a\AppData\Local\Programs\Python\Python37-32\lib\site-packages\reikna\cluda\api_discovery.py", line 38, in supported_api_ids
    return [api_id for api_id in api_ids() if supports_api(api_id)]
  File "C:\Users\a\AppData\Local\Programs\Python\Python37-32\lib\site-packages\reikna\cluda\api_discovery.py", line 38, in <listcomp>
    return [api_id for api_id in api_ids() if supports_api(api_id)]
  File "C:\Users\a\AppData\Local\Programs\Python\Python37-32\lib\site-packages\reikna\cluda\api_discovery.py", line 27, in supports_api
    get_api(api_id)
  File "C:\Users\a\AppData\Local\Programs\Python\Python37-32\lib\site-packages\reikna\cluda\api_discovery.py", line 50, in get_api
    import reikna.cluda.ocl
  File "C:\Users\a\AppData\Local\Programs\Python\Python37-32\lib\site-packages\reikna\cluda\ocl.py", line 60
    dest.set(src, queue=self._queue, async=self._async)
                                         ^
SyntaxError: invalid syntax
fjarri commented 6 years ago

I see, async is a keyword starting from 3.7. I guess I'll have to change the API.

Chakazul commented 4 years ago

One of my user reported similar issue. Is the problem still exist, or should he update the driver / pycuda / pyopencl? https://github.com/Chakazul/Lenia/issues/13#issue-552866567

fjarri commented 4 years ago

This should be fixed starting from 0.7.3

danwills commented 4 years ago

Thanks fjarri! I will totally try 0.7.3 once it's out, and report back : ) Such an awesome project btw! (the cluda layer? genius!) thanks so much for making it public!

fjarri commented 4 years ago

No problem. 0.7.3 was released more than half a year ago :)

To be fair, the idea (and the name) of cluda was lifted from PyCuda/PyOpenCL. Incidentally, a big refactoring is underway, where cluda will be separated from high-level reikna stuff and will support multi-GPU setups transparently (among other things).

danwills commented 4 years ago

Ah yes, apologies I see it now. 0.7.3 (and 0.7.4) sort at the end of the tag list for me, maybe because they don't start with 'v'? Makes them quite easy to miss.

I'm up to date with origin/develop, so I would have thought that would include any fixes that were in 0.7.3, but I haven't checked.

The new refactoring effort sounds great! : )

fjarri commented 4 years ago

Ah yes, my bad about the tag names. The fix should indeed be in develop.