File tree Expand file tree Collapse file tree 2 files changed +17
-0
lines changed
include/boost/compute/distributed Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -181,6 +181,13 @@ class command_queue
181181 return m_queues[n].get_context ();
182182 }
183183
184+ // / Returns true if all device command queues are in the same OpenCL
185+ // / context.
186+ bool one_context () const
187+ {
188+ return m_context.one_context ();
189+ }
190+
184191 // / Returns nth context from command queue's distributed context.
185192 ::boost::compute::device get_device (size_t n) const
186193 {
Original file line number Diff line number Diff line change @@ -147,6 +147,16 @@ class context
147147 return m_contexts[n];
148148 }
149149
150+ // / Returns true if all contexts are in fact the same OpenCL context.
151+ bool one_context () const
152+ {
153+ bool one_context = false ;
154+ for (size_t i = 0 ; i < m_contexts.size (); i++) {
155+ one_context == one_context && (m_contexts[0 ] == m_contexts[i]);
156+ }
157+ return one_context;
158+ }
159+
150160 // / Returns information about nth context.
151161 template <class T >
152162 T get_info (size_t n, cl_context_info info) const
You can’t perform that action at this time.
0 commit comments