Is there a way to force Boost.Compute to use OpenCL 1.2 ?

362 views
Skip to first unread message

mat.f...@gmail.com

unread,
Mar 18, 2015, 1:57:56 PM3/18/15
to boost-...@googlegroups.com
Hello everyone,

I have AMD APP SDK installed on my system, which defines CL_VERSION_2_0 macro.
I also have 3 OpenCL devices installed on my system:
- AMD Radeon R9 280X discrete GPU
- Intel Core i5 4690K CPU
- Intel HD graphics 4600 integrated GPU
Now during command queue creation with Intel HD graphics device I get an exception saying "Invalid device".
The problem is that the Intel GPU is capable of only OpenCL 1.2, however because of that CL_VERSION_2_0 macro Boost.Compute tries to call clCreateCommandQueueWithProperties, which is not supported by my iGPU and thus the exception.

So my question is whether there is any simple way to force Boost.Compute to use OpenCL 1.2 API, because I not planning on using any OpenCL 2.0 features, but I would like to be able to exploit all my compute devices.

Thanks in advance.

Kyle Lutz

unread,
Mar 18, 2015, 10:53:51 PM3/18/15
to mat.f...@gmail.com, boost-...@googlegroups.com
Boost.Compute uses the OpenCL version based on the highest
CL_VERSION_X_Y macro defined in the <CL/cl.h> header. If you want to
force a specific version just set up your include path to find the
OpenCL headers for that specific version. In your case you could
probably just set up your include path to point to the OpenCL headers
provided with the Intel OpenCL 1.2 driver and that should work with
all your devices. You can also download the headers for all OpenCL
versions from Khronos directly [1].

Let me know if you run into any problems with this.

-kyle

[1] https://www.khronos.org/registry/cl/

Matúš Fedorko

unread,
Mar 19, 2015, 12:40:50 PM3/19/15
to Kyle Lutz, boost-...@googlegroups.com
Thank you, Khronos headers did it.
Reply all
Reply to author
Forward
0 new messages