ysh329 / OpenCL-101

Learn OpenCL step by step.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

ysh329 opened this issue · comments

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 */,
 ^

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

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

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

regards,
Jimbo

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.