ysh329 / OpenCL-101

Learn OpenCL step by step.
123 stars 31 forks source link

make warning: ‘clCreateCommandQueue’ is deprecated [-Wdeprecated-declarations] #4

Closed ysh329 closed 6 years ago

ysh329 commented 6 years ago
bandwidth.c: In function ‘main’:
bandwidth.c:262:5: warning: ‘clCreateCommandQueue’ is deprecated [-Wdeprecated-declarations]
     command_queue = clCreateCommandQueue(context, device_id, 0, &ret);
     ^
In file included from bandwidth.c:37:0:
/usr/include/CL/cl.h:1359:1: note: declared here
 clCreateCommandQueue(cl_context                     /* context */,
 ^
ysh329 commented 6 years ago

Add these lines:

#define CL_USE_DEPRECATED_OPENCL_1_2_APIS
#include <CL/cl.h>

ref: compiler errors - Opencl function found deprecated by Visual Studio - Stack Overflow https://stackoverflow.com/questions/28500496/opencl-function-found-deprecated-by-visual-studio

mehdijimbo commented 5 years ago

warning: ‘clCreateCommandQueue’ is deprecated [-Wdeprecated-declarations]

I have similar problem and i believe this can avoid profiling. Do you have any idea?

regards, Jimbo

ysh329 commented 5 years ago

warning: ‘clCreateCommandQueue’ is deprecated [-Wdeprecated-declarations]

I have similar problem and i believe this can avoid profiling. Do you have any idea?

regards, Jimbo

If deprecated, I think you can try to read docs matching your version and device platform.