CommandQueue constructor fixes for CL < 2.0
A runtime problem occurs when an application is compiled with
CL_HPP_TARGET_OPENCL_VERSION >= 200 and CL_HPP_MINIMUM_OPENCL_VERSION < 200. At
compile time the CommandQueue constructor happily runs because it was using
clCreateCommandQueueWithProperties, but when the code was run against a
platform supporting OpenCL < 2.0 then the same function, which was only
introduced in OpenCL 2.0, was being called instead of clCreateCommandQueue
(usually causing a segfault).
This fix is inspired by the constructor of the Image* classes, which use a
combination of macros and runtime version checking to choose which function
should be called.
Signed-off-by: Rodrigo Tobar <[email protected]>
1 file changed