http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/
I don't understand how to check the reference count for say, an openCL context. How is it done? Is there a function call or field? I tried googling and I couldn't figure it out. I tried debugging and inspecting (using JOCL and Java) and I didn't see anything. Let me know.
Take a look clRetain*/clRelease* functions. I guess you were downvoted because they can be found very easily. It wasn't me though.