@@ -65,24 +65,40 @@ class command_queue
6565 }
6666 }
6767
68- // / Creates a distributed command queue containing command queue for each
68+ // / Creates a distributed command queue containing command queues for each
6969 // / corresponding device and context from \p devices and \p contexts.
7070 command_queue (const std::vector< ::boost::compute::context> &contexts,
71- const std::vector<device> &devices,
71+ const std::vector< std::vector< device> > &devices,
7272 cl_command_queue_properties properties = 0 )
7373 {
7474 m_context = context (contexts);
75- size_t n = m_context.size ();
76- for (size_t i = 0 ; i < n; i++) {
75+ for (size_t i = 0 ; i < m_context.size (); i++) {
76+ for (size_t j = 0 ; j < devices[i].size (); j++) {
77+ m_queues.push_back (
78+ ::boost::compute::command_queue (
79+ m_context.get(i), devices[i][j], properties
80+ )
81+ );
82+ }
83+ }
84+ }
85+
86+ // / Creates a distributed command queue for all devices in \p context.
87+ command_queue (const ::boost::compute::context &context,
88+ cl_command_queue_properties properties = 0 )
89+ {
90+ m_context = ::boost::compute::distributed::context (context);
91+ std::vector<device> devices = context.get_devices ();
92+ for (size_t i = 0 ; i < devices.size (); i++) {
7793 m_queues.push_back (
7894 ::boost::compute::command_queue (
79- m_context.get(i) , devices[i], properties
95+ context , devices[i], properties
8096 )
8197 );
8298 }
8399 }
84100
85- // / Creates a distributed command queue.
101+ // / Creates a distributed command queue containing \p queues .
86102 explicit
87103 command_queue (const std::vector< ::boost::compute::command_queue> queues)
88104 : m_queues(queues)
0 commit comments