Hello,
I’m implementing a resampler with FIR filter in OpenCL and I’m experiencing some strange behaviour with clEnqueueReadBuffer function. I’m using GeForce GTX 275 with 190.89 drivers, Windows 7 32-bit.
My resampling function is cyclically called, every time with new input data. In first iteration, necessary buffers are created (input and output), after that only input is written to GPU using clEnqueueWriteBuffer (blocking), kernel executed (parameters set in 1st iteration), then blocking read with clEnqueueReadBuffer.
And here comes the trouble. I’m testing it on 10000 iterations, but with the same data, something like this:
[codebox]
//Make resampler object
//Make 2 float arrays
//Load input array with some data
//Set filter coefficients, resampling ratio
for(i=0;i<10000;++i)
{ res = resampler.resample(INPUT_LEN,input,output); //res==0 means error
if(res==0)
break;
}
[/codebox]
I get -5 return code from clEnqueueWriteBuffer when reading computed data, but after random number of iterations. Sometimes its cca 7000, sometimes it crashes after second iteration, but seems quite random. Never got higher than cca 7300 iterations and never below 2. Whats the problem? And what does the return code mean? Its not a value specified in sepcification document.