从内核入队内核会导致错误的构建错误
我需要从另一个内核启动一个内核,因此我阅读了 OpenCL 规范并完全按照所述操作,但我得到了 CL_BUILD_PROGRAM_FAILURE。也许我的opencl版本低于2.0,但我已经下载了带有CUDA的OpenCL,所以通常版本高于2.0,对吧?
这是我的内核代码:
__kernel void funcB(__global int* a)
{
//blabla
}
__kernel void funcA(__global int* a, const size_t n)
{
//blabla
void (^funcB)(void) = ^{funcB(a);};
enqueue_kernel(get_default_queue(), CLK_ENQUEUE_FLAGS_WAIT_KERNEL,
ndrange_1d(n), funcB);
}
我还需要在主机代码中创建一个“cl_kernel funcB”对象吗?或者导入
感谢您的帮助。
I need to launch a kernel from another kernel so I read the OpenCL specs and did exactly as mentioned but I got a CL_BUILD_PROGRAM_FAILURE. Maybe my opencl version is less than 2.0 but I have downloaded OpenCL with CUDA so normally the version is upper than 2.0 right?
Here is my kernel code :
__kernel void funcB(__global int* a)
{
//blabla
}
__kernel void funcA(__global int* a, const size_t n)
{
//blabla
void (^funcB)(void) = ^{funcB(a);};
enqueue_kernel(get_default_queue(), CLK_ENQUEUE_FLAGS_WAIT_KERNEL,
ndrange_1d(n), funcB);
}
Do I also need to create a 'cl_kernel funcB' object in the host code ?? Or maybe import a header other than <CL/cl.h> ?
Thanks for the help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您无法在 OpenCL 1.1/1.2/3.0 设备上使用 OpenCL 2.0/2.1/2.2 功能。
Nvidia GPU 仅支持 OpenCL C 1.2 语言标准(您可以使用 cl_device.getInfo() 查询)。 Nvidia 最近“升级”到了 OpenCL 3.0 版本,但这只是 1.2 版本的新名称。 OpenCL 2.0/2.1/2.2 功能仍不受支持。
You can't use OpenCL 2.0/2.1/2.2 features on OpenCL 1.1/1.2/3.0 devices.
Nvidia GPUs only support the OpenCL C 1.2 language standard (you can query this with
cl_device.getInfo<CL_DEVICE_OPENCL_C_VERSION>()
). Nvidia recently "upgraded" to OpenCL version 3.0, but this is just a new name for version 1.2. OpenCL 2.0/2.1/2.2 features are still not supported.