您好, 欢迎来到 !    登录 | 注册 | | 设为首页 | 收藏本站

python – pyOpenCL和opencl4py之间的区别

5b51 2022/1/14 8:20:17 python 字数 3016 阅读 462 来源 www.jb51.cc/python

今天我偶然发现了stackoverflow中的帖子(另请参见 here): We are developing 07001, higher level bindings. This project uses CFFI, so it works on Pypy. The major issue we encountered with pyopencl is that ‘import pyopencl

概述

We are developing 07001,higher level bindings. This project uses CFFI,so it works on Pypy.

The major issue we encountered with pyopencl is that ‘import pyopencl’ does OpenCL initialization and takes the whole virtual memory in case of NVIDIA driver,preventing from correct forking and effectively disabling multiprocessing (yes,we claim that using pyopencl disables multiprocessing at least with NVIDIA). opencl4py uses lazy OpenCL initialization,resolving this “import hell”.

Later,it gained some nice features like super easy binary program caching,etc. Unfortunately,the documentation is somewhat brief. The best way to learn how it works is go through the tests.

由于还有pyOpenCL,我想知道这两个包之间的区别是什么.有谁知道我在哪里可以找到关于这两个包的专业人士和骗子的概述?

编辑:包括benshope的评论,因为我也会感兴趣:“禁用[s]多处理”是什么意思?比如,它不能同时在几个设备上运行内核?

> pyOpenCL是一个成熟的项目,拥有相对较大的用户群.有教程,常见问题解答等opencl4py出现在03/2014;没有教程,常见问题等等 – 只有单元测试和文档字符串.
> pyOpenCL是本机cpython扩展,而opencl4py使用cffi,因此它适用于PyPy(pyOpenCL不工作),并且每次cpython更改版本时都不需要重新编译.
> PyOpenCL有额外功能,例如随机生成器和OpenGL互操作性.
> opencl4py在三星生产现实场景中进行了广泛测试,并且正在积极开发中.

what does “disable[s] multiprocessing” mean? Like,it can’t run kernels on several devices at one time?

当然,它可以,我试图说导入pyopencl后,os.fork()或multiprocessing.Process()会导致NVIDIA OpenCL用户空间库内的崩溃.在导入期间做工作总是一个坏主意.

总结

以上是编程之家为你收集整理的python – pyOpenCL和opencl4py之间的区别全部内容,希望文章能够帮你解决python – pyOpenCL和opencl4py之间的区别所遇到的程序开发问题。


如果您也喜欢它,动动您的小指点个赞吧

除非注明,文章均由 laddyq.com 整理发布,欢迎转载。

转载请注明:
链接:http://laddyq.com
来源:laddyq.com
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。


联系我
置顶