I am using imx6 quad, running Windows Embedded Compact 7 (aka WEC7, Windows CE 7, CE7). The BSP came from Adeneo.
I have found what I believe is a memory leak in the OpenCL software stack. A very simple Vector_Add program runs in a loop ~8000 times and fails with CL error -6.
This file is attached. The .cl file is also attached.
If anyone is an expert in OpenCL and can spot a fault with the Vector_Add program, let me know.
Otherwise, if the problem looks to be in the OpenCL software stack, what is the support model?
How do I get this fixed?
andyp
Original Attachment has been moved to: vector_add_kernel.cl.txt.zip
Original Attachment has been moved to: Vector_Add1.cpp.txt.zip
More investigation and characterization of the OpenCL memory leak bug reveals that if clCreateContext() is called once, and clReleaseContext() is never called, then the program runs correctly without a memory leak.
My conclusion is that the problem is with clReleaseContext().
Deactivated user, could you please comment?
I added some more checking to my simple OpenCL program.
The checking looked at the reference count for all the OpenCL data structures created with the clCreate* API's. This includes the context, kernel, program, memory buffers, etc.
I found a surprising reference count = 2 for both the kernel object and the program object.
Could there be an implicit increment of the ref count for these 2 objects?
I modified the program to do 2 clReleaseProgram(...) calls and do 2 clReleaseKernel(...) calls each time through the loop.
Now I am retesting.