OpenCL interoperability does not work on 64-bit OS
还没有人认领这个 Issue。
评估
调研方向
受影响的入口点位于 arrayfire/opencl.py 的第 88 行和第 156 行附近,以及该文件中其他使用 c_int_t 的位置。先阅读这些 ctypes 声明,然后复现 64 位 Windows OpenCL/PyOpenCL 设置;完成的标准是设备 ID 以及共享的设备、上下文和队列值不再溢出,并且互操作性正常工作。
由索引模型根据 Issue 内容生成。
描述
Currently the OpenCL interoperability does not work on 64-bit Windows machine. The reason for this is the use of c_int_t which defaults to long on Windows (which on the other hand is 32-bit). This can be problematic with things like device IDs as they can easily go over 2^32/2-1. For example https://github.com/arrayfire/arrayfire-python/blob/master/arrayfire/opencl.py#L88 uses c_int_t, as well as a few other functions in the same file. This can be fixed by replacing the c_int_t with, for example, c_void_ptr_t as it is used with the context. Is there by the way some specific reason why context is treated differently?
There is also another issue. When the context is created by PyOpenCL, the input device, context and queue values are input as python ints in order to use the same context and queue, but on Windows you get <class 'OverflowError'>: int too long to convert errors then. These can be avoided by casting them to, for example, c_int64-types. For example in https://github.com/arrayfire/arrayfire-python/blob/master/arrayfire/opencl.py#L156, replace safe_call(backend.get().afcl_add_device_context(dev, ctx, que)) with safe_call(backend.get().afcl_add_device_context(ct.c_int64(dev), ct.c_int64(ctx), ct.c_int64(que))) (using c_void_p seems to work too).
I haven't tested these changes extensively, but they do seem to get things working on 64-bit Windows. I can provide a PR if needed.
- 主要语言
- Python
- 星标
- 422
- 派生
- 63
- PR 合并指标
- 30 天内没有已合并 PR
贡献指南
这个仓库没有索引到贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
arrayfire/arrayfire-python 的其他 Issue
-
难度 5/5 一周以上 新手友好度 25/100
arrayfire/arrayfire-python#271 ·
-
难度 5/5 一周以上 新手友好度 25/100
arrayfire/arrayfire-python#270 ·
-
难度 4/5 3-5 天 新手友好度 35/100
arrayfire/arrayfire-python#269 ·
-
难度 4/5 3-5 天 新手友好度 38/100
arrayfire/arrayfire-python#268 · 1 条评论 ·
-
难度 3/5 1-2 天 新手友好度 48/100
arrayfire/arrayfire-python#267 · 1 条评论 · 1 个 reaction ·
查看 arrayfire/arrayfire-python 的全部 Issue
相似的 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 90/100
learningequality/ricecooker#747 ·
-
难度 2/5 1-3 小时 新手友好度 68/100
BSData/horus-heresy-3rd-edition#3171 ·
-
enhancement
难度 2/5 1-3 小时 新手友好度 72/100
-
难度 2/5 1-3 小时 新手友好度 76/100
run-llama/llama_index#23199 ·
-
难度 2/5 1-3 小时 新手友好度 84/100
KhronosGroup/glTF-Blender-IO#2769 ·