When I use OpenCL to process many chunks of data it crashes in the 7th iteration.
I ensure that memory is released before each iteration of the loop, and allocated again for new chunk, but the crash still occurs with an error of -38 on Clenqueuewritebuffer()
I have tried a lot, but am not getting anywhere.
The following is the flow of my code :
clGetPlatformIDs
clGetDeviceIDs
clCreateContext
clCreateCommandQueue
clCreateProgramWithSource
clBuildProgram
clCreateKernel
for(x){
clCreateBuffer
clEnqueueWriteBuffer
clSetKernelArg
clEnqueueNDRangeKernel
clFinish
clEnqueueMapBuffer
clReleaseMemObject
}
Is it correct or do I have to use it in other ways?
If so, What am I doing wrong?...