@@ -175,13 +175,15 @@ the following types:
175
175
* sycl::half
176
176
177
177
The properties supported with `annotated_arg` may be defined in
178
- separate extensions.
178
+ separate extensions. Please note that there cannot be duplicated property in a
179
+ properties list. Otherwise, a compiler time error is triggered.
179
180
180
181
The section below describes the constructors and member functions for
181
182
`annotated_arg`.
182
183
183
184
The template parameter `T` in the definition of `annotated_arg` template below
184
- must be a legal parameter type as defined by the SYCL specification.
185
+ must be a legal parameter type as defined by the SYCL specification. Given `annotated_arg<T, ...>`,
186
+ `T` must be a trivially copy-able type.
185
187
186
188
[source,c++]
187
189
----
@@ -190,7 +192,7 @@ template <typename T, typename PropertyListT = properties<>>
190
192
class annotated_arg {
191
193
public:
192
194
annotated_arg() noexcept;
193
- annotated_arg(const T& v_, const properties< PropertyListT> &P = properties{}) noexcept;
195
+ annotated_arg(const T& v_, const PropertyListT &P = properties{}) noexcept;
194
196
template<typename... PropertyValueTs>
195
197
annotated_arg(const T& v_, PropertyValueTs... props) noexcept;
196
198
@@ -204,19 +206,13 @@ class annotated_arg {
204
206
annotated_arg& operator=(annotated_arg&) = default;
205
207
206
208
// Conversion operator to convert to the underlying type
207
- operator T& () noexcept;
208
- operator const T& () const noexcept;
209
+ operator T() noexcept;
210
+ operator const T() const noexcept;
209
211
210
212
// Available if the operator[] is valid for objects of type T, return
211
213
// type will match the return type of T::operator[](std::ptrdiff_t)
212
214
/* ... */ operator[](std::ptrdiff_t idx) const noexcept;
213
215
214
- // Available if the operator() is valid for objects of type T, return
215
- // type will match the return type of
216
- // template<typename... Args> T::operator()(Args... args)
217
- template<typename... Args> /* ... */ operator()(Args... args) noexcept;
218
- template<typename... Args> /* ... */ operator()(Args... args) const noexcept;
219
-
220
216
template<typename propertyT>
221
217
static constexpr bool has_property();
222
218
@@ -228,12 +224,16 @@ class annotated_arg {
228
224
229
225
//Deduction guides
230
226
template <typename T, typename... Args>
231
- annotated_arg(T, Args... args) -> annotated_arg<T, detail::properties_t<Args...>>;
227
+ annotated_arg(T, Args... args) ->
228
+ annotated_arg<T, detail::properties_t<Args...>>;
232
229
233
- template <typename T, typename oldProp, typename otherProp >
234
- annotated_arg(annotated_arg< T, oldProp>, otherProp other)
235
- -> annotated_arg<T, detail::merged_properties_t<oldProp, otherProp >>;
230
+ template <typename T, typename... Args >
231
+ annotated_arg(T, properties<std::tuple<Args...>>) ->
232
+ annotated_arg<T, detail::properties_t<Args... >>;
236
233
234
+ template <typename T, typename old, typename... Args>
235
+ annotated_arg(annotated_arg<T, old>, properties<std::tuple<Args...>>) ->
236
+ annotated_arg<T, detail::merged_properties_t<old, detail::properties_t<Args...>>>;
237
237
} // namespace sycl::ext::oneapi::experimental
238
238
----
239
239
@@ -260,7 +260,6 @@ annotated_arg(const T& v_, const PropertyListT &P = properties{}) noexcept;
260
260
Constructs an `annotated_arg` object from the input object `v_`.
261
261
262
262
The new property set `PropertyListT` contains all properties in `P`.
263
- If there are duplicate properties present in the property list of `P`, the values of the duplicate properties must be the same.
264
263
265
264
// --- ROW BREAK ---
266
265
a|
269
268
template<typename... PropertyValueTs>
270
269
annotated_arg(const T& v_, const PropertyValueTs... props) noexcept;
271
270
----
272
- |
271
+ | Not available in device code.
273
272
Constructs an `annotated_arg` object from the input object `v_`.
274
273
275
- The new property set `PropertyListT` contains all properties in `P`.
276
- If there are duplicate properties present in the property list of `P`, the values of the duplicate properties must be the same.
274
+ The new property set `PropertyListT` contains all properties listed in `props`.
277
275
278
276
// --- ROW BREAK ---
279
277
a|
282
280
template <typename T2, typename P> explicit annotated_arg(
283
281
const annotated_arg<T2, P> &ConvertFrom);
284
282
----
285
- |
283
+ | Not available in device code.
286
284
Constructs the `annotated_arg` object from the `ConvertFrom` object if
287
285
the list of properties in `PropertyListT` is a superset of the list of
288
286
properties in `P`.
@@ -297,7 +295,7 @@ template <typename T2, typename PropertyListU, typename PropertyListV>
297
295
explicit annotated_arg(const annotated_arg<T2, PropertyListU>& v_,
298
296
properties<PropertyListV> P) noexcept;
299
297
----
300
- |
298
+ | Not available in device code.
301
299
Constructs the `annotated_arg` object from the input object `v_`.
302
300
303
301
The new `PropertyListT` is the union of all properties contained within
@@ -307,13 +305,13 @@ properties with the same value (or no value) are allowed.
307
305
308
306
`T2` must be implicitly convertible to `T`.
309
307
310
-
311
308
// --- ROW BREAK ---
312
309
a|
313
310
[source,c++]
314
311
----
315
312
annotated_arg(const annotated_arg&) = default;
316
313
----
314
+ | Not available in device code.
317
315
Compiler generated copy constructor.
318
316
319
317
// --- ROW BREAK ---
322
320
----
323
321
annotated_arg& operator=(annotated_arg&) = default;
324
322
----
325
- Compiler generated assignment operator.
323
+ | Compiler generated assignment operator.
326
324
327
325
// --- ROW BREAK ---
328
326
a|
343
341
Available if the `operator[]` is valid for objects of type `T`. This function
344
342
will call the subscript operator defined for `T`.
345
343
346
- // --- ROW BREAK ---
347
- a|
348
- [source,c++]
349
- ----
350
- template<typename... Args> /* ... */ operator()(Args... args) noexcept;
351
- template<typename... Args> /* ... */ operator()(Args... args) const noexcept;
352
- ----
353
- |
354
- Available if the `operator()` is valid for objects of type `T`. This function
355
- will call the 'call operator' defined for `T`.
356
-
357
344
// --- ROW BREAK ---
358
345
a|
359
346
[source,c++]
0 commit comments