Set "event" as the parameter of the output event of the "clfftEnqueueTransform" function, and use "clWaitForEvents" to wait for the event to complete, and use "event" to calculate the Fourier transform time 1. The code is as follows:
int PC1D::fft(cl_mem& src, cl_mem& dst)
{
cl_event event;
clfftEnqueueTransform(_separatePlan, CLFFT_FORWARD, 1, &_commandQue, 0, NULL, &event, &src, &dst, NULL);
}
The second method: Use the clFinish function to wait for the command queue to complete execution, and get the time of the system timer before and after execution, giving time 2.The code is as follows:
clFinish(_commandQue);
tic(0);
fft(_receipt,_receipt);
clFinish(_commandQue);
toc(0, "Total time: ");
It is found that time 2 is 6 or 7 times that of time 1. What is the cause of this?
Set "event" as the parameter of the output event of the "clfftEnqueueTransform" function, and use "clWaitForEvents" to wait for the event to complete, and use "event" to calculate the Fourier transform time 1. The code is as follows: int PC1D::fft(cl_mem& src, cl_mem& dst) { cl_event event; clfftEnqueueTransform(_separatePlan, CLFFT_FORWARD, 1, &_commandQue, 0, NULL, &event, &src, &dst, NULL);
} The second method: Use the clFinish function to wait for the command queue to complete execution, and get the time of the system timer before and after execution, giving time 2.The code is as follows: clFinish(_commandQue); tic(0); fft(_receipt,_receipt); clFinish(_commandQue); toc(0, "Total time: "); It is found that time 2 is 6 or 7 times that of time 1. What is the cause of this?