cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

sajis997
Adept I

encapsulate context creation

Hello,

I need to use the opencl context and its associated command queues across several classes and therefore i am planning to encapsulate the opencl context creation into a single class and make a singleton instance of it. That instance will be used by several other class objects in the application.

Is my plan in the right direction ?

Is it necessary to use the clRetainContext() some where here ?

Thanks

0 Likes
1 Reply
pinform
Staff

Your approach seems correct.  clRetainContext() can be useful to verify whether the context is valid across functions.

0 Likes