thank you very much for your reply!
i solved this issue… now i have another problem
i want to compare the cpu time and the opencl time in my code my code is the following…
//first i define the cl_event
cl_ulong start, end;
cl_event event;
…(code)…
/* Create a command queue */
queue = clCreateCommandQueue(context, device, CL_QUEUE_PROFILING_ENABLE , &err);
if(err < 0) {
perror(“Couldn’t create a command queue 1”);
printf("error %d
", err);
exit(1);
};
…(code)…
err = clGetEventProfilingInfo(event, CL_PROFILING_COMMAND_END, sizeof(cl_ulong), &end, NULL);
if(err < 0) {
perror(“time error end 1 %d”);
printf("error %d
", err);
exit(1);
}
/* Read the kernel’s output DILADI OUSIASTIKA TO DIST */
err = clEnqueueReadBuffer(queue, d_result_Dist.elements, CL_TRUE, 0, sizeDist, Dist, 0, NULL, NULL);
if(err < 0) {
perror(“Couldn’t enqueue the kernel 1 %d”);
printf("error %d
", err);
exit(1);
}
err=clGetEventProfilingInfo(event, CL_PROFILING_COMMAND_START, sizeof(cl_ulong), &start, NULL);
if(err < 0) {
perror(“time error start 1”);
printf("error %d
", err);
exit(1);
}
float executionTimeInMilliseconds1 = (end - start) * 1.0e-6f;
printf("[OPENCL] Time elapsed for GPU first kernel: %f s
", executionTimeInMilliseconds1);
you can notice that i define the CL_QUEUE_PROFILING_ENABLE in my queue but i take the bug -7, that means #define CL_PROFILING_INFO_NOT_AVAILABLE -7
so i am wondering where is my fault…
look this link, i find it useful to solve my problem but i still have this bug
http://stackoverflow.com/questions/1015 … easurement