Platform : Windows 7 : 64 bit
Compiler : MSVC, AMD OpenCL
I have the following piece of code which I am compiling with MSVC and AMD OpenCL compiler.
I have pasted my code here : http://pastebin.com/M1A5kzd8.If I remove my timing code (comment out line no 😎 the code runs fine.If I add my timing code the program hangs at line no : 61. in function clCreateCommandQueue.
Could you please let me know what could be the possible reason.
I have tested my timing code with a hello world (without OpenCL) and it works fine.
I think when you create command queue you should add CL_QUEUE_PROFILING_ENABLE flag to get timing info out of kernel. I did it like this:
commandQueue = clCreateCommandQueue(context, devices, CL_QUEUE_PROFILING_ENABLE, &status);
Hope it works for you too!
Thanks for your help. This was not what I was looking for. I am not looking to time the amout of time the kernel tool to execute. I am trying to figure out the amount of time it took to build (compiling) the kernel.
I guess you should use some timer across the clCreateProgram + clBuildProgram for that. But this is purely implementation behind and I am not aware of AMD's implementation details, so it is just a guess.
The above code is doing exactly that. For some strange reason it hangs inside clCreateCommandQueue
I am able to run your code. MY system is Vista64 HD 5770 .
Value of Clocks_per_sec : 0.000000 ticks/sec
freq test: 25000000 ticks/sec
QueryPerformanceCounter testpoint : 300455847858 ticks
Elapsed CPU time test: 0.130063040 sec ticks 3251576
Press any key to continue . . .