Hey all…
Was working an example that I seen on youtube. It’s a CPP project. Was getting compile errors in cl.hpp.
Here are the statements and the Visual Studio comp errors I was getting… I’m hoping you guys might shed a little light. The OpenCL I am using is from the Windows Intel OpenCL SDK.
Warning C4603 'CL_USE_DEPRECATED_OPENCL_2_0_APIS': macro is not defined or definition is different after precompiled header use
Error C4996 'clCreateSampler': was declared deprecated
Error C4996 'clCreateCommandQueue': was declared deprecated
Error C4996 'clCreateCommandQueue': was declared deprecated
Error C4996 'clCreateCommandQueue': was declared deprecated
Error C4996 'clEnqueueTask': was declared deprecated
So, in order to try and work around these errors, I did the following to each line of code in the header file.
#pragma warning(suppress : 4996)
object_ = ::clCreateSampler( context(), normalized_coords, addressing_mode, filter_mode, &error);
#pragma warning(suppress : 4996)
object_ = ::clCreateCommandQueue(context(), device(), properties, &error);
#pragma warning(suppress : 4996)
::clEnqueueTask(
object_, kernel(),
(events != NULL) ? (cl_uint) events->size() : 0,
(events != NULL && events->size() > 0) ? (cl_event*) &events->front() : NULL,
(event != NULL) ? &tmp : NULL),
__ENQUEUE_TASK_ERR
);