Killing OpenCL Kernels

我只是一个虾纸丫 提交于 2019-12-06 02:39:13
Eric Bainville

No, the OpenCL API doesn't allow to interrupt a running kernel. On some systems, a kernel running for more than a few seconds will be killed by the driver.

Ref. for Windows: Timeout Detection and Recovery of GPUs through WDDM, and for Linux+NVidia: Using CUDA and X.

Nothing in the standard guarantees your option 1 will work. It almost certainly won't. Your option 2 will work, but then you will have to communicate with the other process.

Splitting the kernel in smaller kernels, as suggested in the comments, is probably the best option.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!