OpenCL-SDK icon indicating copy to clipboard operation
OpenCL-SDK copied to clipboard

Remove compile-time checks for deciding which OpenCL function should be used

Open Beanavil opened this issue 1 year ago • 0 comments

In some samples, namely binaries, blur, reduce, multi-device and saxpy from samples/core, compile-time checks like the following

#if CL_HPP_TARGET_OPENCL_VERSION >= 200
    cl_command_queue_properties props[] = { CL_QUEUE_PROPERTIES,
                                            CL_QUEUE_PROFILING_ENABLE, 0 };
    OCLERROR_PAR(queue = clCreateCommandQueueWithProperties(context, device,
                                                            props, &error),
                 error, prg);
#else
    OCLERROR_PAR(queue = clCreateCommandQueue(
                     context, device, CL_QUEUE_PROFILING_ENABLE, &error),
                 error, prg);
#endif

are present for deciding whether the 1.x or 2.x version of a function should be used. These should either be removed completely (and use the 1.x version always) or substituted for runtime checks based on the properties of the device.

Beanavil avatar Dec 07 '23 14:12 Beanavil