@@ -65,24 +65,40 @@ class command_queue
65
65
}
66
66
}
67
67
68
- // / Creates a distributed command queue containing command queue for each
68
+ // / Creates a distributed command queue containing command queues for each
69
69
// / corresponding device and context from \p devices and \p contexts.
70
70
command_queue (const std::vector< ::boost::compute::context> &contexts,
71
- const std::vector<device> &devices,
71
+ const std::vector< std::vector< device> > &devices,
72
72
cl_command_queue_properties properties = 0 )
73
73
{
74
74
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++) {
77
93
m_queues.push_back (
78
94
::boost::compute::command_queue (
79
- m_context.get(i) , devices[i], properties
95
+ context , devices[i], properties
80
96
)
81
97
);
82
98
}
83
99
}
84
100
85
- // / Creates a distributed command queue.
101
+ // / Creates a distributed command queue containing \p queues .
86
102
explicit
87
103
command_queue (const std::vector< ::boost::compute::command_queue> queues)
88
104
: m_queues(queues)
0 commit comments