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, the full system freezes. I am using a desktop with AMD A10-6800K APU with Radeon(tm) HD Grap which contains devastator GPU.
I also applied clFInish after each kernel to make sure the synchronization. But that did not help either. The system freezes.
Whenever the system freezes I restarts teh machine.
Please suggest me what could be the possible cause of the error? Any help would be appreciated.
Here is my psuodo code:
Main()
{
for (;;)
{
grab a frame;
detectface(frame);
writing the frame to output;
}
}
detectface(frame)
{
tranfer frame to oclMatrix; //the error occurs at this point, my guess.
while some conditions are true:
while some conditions are true:
kernel1; //parameter: one oclmatrix for source, one for output, two temporary ocl matrix for calculation
kernel2;//parameter: one oclmatrix for source, one for output, one temporary ocl matrix for calculation
kernel3;//parameter: one oclmatrix for source, one for output, two temporary ocl matrix for calculation
kernel4;//parameter: one oclmatrix for source, one for output, one temporary ocl matrix for calculation
end;
kernel5; //this does the detection and gives a output. parameter: one oclmatrix for source, one for output, 4 temporary ocl matrix for cascade classifier.
end;
}