Raistmer

FFT sample from SDK 2.01

Discussion created by Raistmer on Feb 13, 2010
Latest reply on Feb 13, 2010 by n0thing
what should it demostrate??

Do I understand right that this sample is hard-coded 1k forward FFT transform only?
Even reference CPU version in this sample can do more, at least FFT direction can be chosen....

And concrete question:
[code]
/* Read real output data */
status = clEnqueueReadBuffer(
commandQueue,
buffer_i,
CL_TRUE,
0,
length * sizeof(cl_float),
output_i,
0,
NULL,
&events[1]);
/* Read imaginary output data */
status = clEnqueueReadBuffer(
commandQueue,
buffer_r,
CL_TRUE,
0,
length * sizeof(cl_float),
output_r,
0,
NULL,
&events[2]);

/* Wait for the read buffer to finish execution */
status = clWaitForEvents(1, &events[1]);
status |= clWaitForEvents(1, &events[2]);
[/code]

Why one should wait on event in this code ?
ReadBuffer goes with CL_TRUE, that is accordingly manual it should be blocking call, i.e. it returns only when buffer transfer completed.
Is it error in sample or I'm missing something here?

Outcomes