OpenCL for Python

后端 未结 4 1152
无人共我
无人共我 2021-02-13 10:56

I\'m looking for a good OpenCL wrapper\\library for Python, with good documentation. I tried to search some... but couldn\'t find one good enough.

4条回答
  •  一个人的身影
    2021-02-13 11:38

    pycl is a ctypes binding to OpenCL (hosted on bitbucket)

    Its primary goal is simple: wrap OpenCL in such a way that as many Python implementations can use it as feasible. It is currently tested on CPython 2.{5,6,7}, 3.2, and PyPy 1.5. It is known to largely not work on Jython, whose ctypes library is still immature.

    To achieve this, we eschew extension modules and dependencies outside of the standard library. Ideally things like NumPy arrays and PIL images should Just Work, but they shouldn't be required

    It's currently pretty new. I've been playing with it recently and it's working nicely. Not done timings compared to PyOpenCL, but the performance appears to be perfectly reasonable

    I didn't work for me with OS X 10.6's OpenCL 1.0 (and an AMD Radeon 5870, see here), but works perfectly under 10.7 and OpenCL 1.1

    As for documentation, it's a fairly direct bindings to the C libraries, so any documentation those will apply. Also "Adventures in PyOpenCL" is good, and applies to almost all bindings

提交回复
热议问题