I am trying to run face detection on a 5 minute 720P video. I am using opencv API and opencl kernels to do my job. When I try to run the program, it runs fine for intial few number of frames. But after some frames, it gives me an error
OpenCV Error: Gpu API call (CL_EXEC_STATUS_ERROR_FOR_EVENTS_IN_WAIT_LIST) in openCLMemcpy2D, file /opencv-2.4.6.1/modules/ocl/src/initialization.cpp, line 466
Sometimes I get this error after processing 200 frames, sometimes I get this error after 2000 frames. Can anyone suggest me why I am facing this error and what could be a possible solution? I searched internet but did not find anythng.
UPDATE: I executed the program on my desktop PC which has a AMD APU. The whole machine freezed after processing some frame. I also applied clFinish after each kernel to make sure teh synchronization. Even though, the system freezed. So, it is not a synchronization issue.