28
28
#define __STDC_FORMAT_MACROS 1
29
29
#endif
30
30
#include < cinttypes>
31
+ #include < type_traits>
31
32
#include < utility>
32
33
33
34
// having _TWO_ mid-param #ifdefs makes the functions very difficult to read.
@@ -123,10 +124,68 @@ class __SYCL_EXPORT queue {
123
124
queue (const async_handler &AsyncHandler, const property_list &PropList = {})
124
125
: queue(default_selector(), AsyncHandler, PropList) {}
125
126
127
+ #if __cplusplus >= 201703L
128
+ // / Constructs a SYCL queue instance using the device identified by the
129
+ // / device selector provided.
130
+ // / \param DeviceSelector is SYCL 2020 Device Selector, a simple callable that
131
+ // / takes a device and returns an int
132
+ // / \param AsyncHandler is a SYCL asynchronous exception handler.
133
+ // / \param PropList is a list of properties for queue construction.
134
+ template <typename DeviceSelector,
135
+ typename = detail::EnableIfDeviceSelectorInvocable<DeviceSelector>>
136
+ explicit queue (const DeviceSelector &deviceSelector,
137
+ const async_handler &AsyncHandler,
138
+ const property_list &PropList = {})
139
+ : queue(detail::select_device(deviceSelector), AsyncHandler, PropList) {}
140
+
141
+ // / Constructs a SYCL queue instance using the device identified by the
142
+ // / device selector provided.
143
+ // / \param DeviceSelector is SYCL 2020 Device Selector, a simple callable that
144
+ // / takes a device and returns an int
145
+ // / \param PropList is a list of properties for queue construction.
146
+ template <typename DeviceSelector,
147
+ typename = detail::EnableIfDeviceSelectorInvocable<DeviceSelector>>
148
+ explicit queue (const DeviceSelector &deviceSelector,
149
+ const property_list &PropList = {})
150
+ : queue(detail::select_device(deviceSelector), async_handler{},
151
+ PropList) {}
152
+
153
+ // / Constructs a SYCL queue instance using the device identified by the
154
+ // / device selector provided.
155
+ // / \param SyclContext is an instance of SYCL context.
156
+ // / \param DeviceSelector is SYCL 2020 Device Selector, a simple callable that
157
+ // / takes a device and returns an int
158
+ // / \param PropList is a list of properties for queue construction.
159
+ template <typename DeviceSelector,
160
+ typename = detail::EnableIfDeviceSelectorInvocable<DeviceSelector>>
161
+ explicit queue (const context &syclContext,
162
+ const DeviceSelector &deviceSelector,
163
+ const property_list &propList = {})
164
+ : queue(syclContext, detail::select_device(deviceSelector, syclContext),
165
+ propList) {}
166
+
167
+ // / Constructs a SYCL queue instance using the device identified by the
168
+ // / device selector provided.
169
+ // / \param SyclContext is an instance of SYCL context.
170
+ // / \param DeviceSelector is SYCL 2020 Device Selector, a simple callable that
171
+ // / takes a device and returns an int
172
+ // / \param AsyncHandler is a SYCL asynchronous exception handler.
173
+ // / \param PropList is a list of properties for queue construction.
174
+ template <typename DeviceSelector,
175
+ typename = detail::EnableIfDeviceSelectorInvocable<DeviceSelector>>
176
+ explicit queue (const context &syclContext,
177
+ const DeviceSelector &deviceSelector,
178
+ const async_handler &AsyncHandler,
179
+ const property_list &propList = {})
180
+ : queue(syclContext, detail::select_device(deviceSelector, syclContext),
181
+ AsyncHandler, propList) {}
182
+
183
+ #endif
184
+
126
185
// / Constructs a SYCL queue instance using the device returned by the
127
186
// / DeviceSelector provided.
128
187
// /
129
- // / \param DeviceSelector is an instance of SYCL device selector .
188
+ // / \param DeviceSelector is an instance of a SYCL 1.2.1 device_selector .
130
189
// / \param PropList is a list of properties for queue construction.
131
190
queue (const device_selector &DeviceSelector,
132
191
const property_list &PropList = {})
@@ -135,7 +194,7 @@ class __SYCL_EXPORT queue {
135
194
// / Constructs a SYCL queue instance with an async_handler using the device
136
195
// / returned by the DeviceSelector provided.
137
196
// /
138
- // / \param DeviceSelector is an instance of SYCL device selector .
197
+ // / \param DeviceSelector is an instance of SYCL 1.2.1 device_selector .
139
198
// / \param AsyncHandler is a SYCL asynchronous exception handler.
140
199
// / \param PropList is a list of properties for queue construction.
141
200
queue (const device_selector &DeviceSelector,
0 commit comments