The Khronos Group - a non-profit industry consortium to develop, publish and promote open standard, royalty-free media authoring and acceleration standards for desktop and handheld devices, combined with conformance qualification programs for platform and device interoperability.

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

clCreateProgramWithSource deletes context?

Hi,

My application has multiple kernels that I compile from different source files using clCreateProgramWithSource. However, after my second call to clCreateProgramWithSource, gDebugger is reporting my CL context as being deleted.
I have note made any call to clReleaseContext, and tried putting a breakpoint on it in gDebugger to check if it was called somewhere.
So I am wondering what can trigger a context deletion?

Re: clCreateProgramWithSource deletes context?

have you checked all errorcodes. Most of the time the context is lost because of an error. If you try to compile the sources in multiple instances you also have to check CL_DEVICE_AVAILABLE. It could be a problem also.

Re: clCreateProgramWithSource deletes context?

Thanks for your reply clint3112.

I found out that I was releasing the program after creating it which apparently caused the lost of context. However, OpenCL didn't return any errors upon using the context for creating other kernels and my application could still run even after the context deletion... I guess OpenCL still has a lot to do in terms of error reporting, but anyway problem solved, thanks!