18 #include <type_traits>
25 template <
typename T,
typename PropertyList>
30 inline namespace _V1 {
33 namespace experimental {
41 !std::is_void_v<decltype(std::declval<T>().operator[](0))>> {};
44 template <
class T,
class P>
46 template <
class T,
class P>
58 std::remove_cv_t<std::remove_reference_t<T>>>::type;
63 template <
typename T,
typename... Args>
67 template <
typename T,
typename old,
typename... ArgT>
72 template <
typename T,
typename PropertyListT = empty_properties_t>
75 static constexpr
bool is_valid_property_list =
81 template <
typename T,
typename... Props>
88 template <
typename T2,
typename PropertyListT>
friend class annotated_arg;
90 #ifdef __ENABLE_USM_ADDR_SPACE__
102 #ifdef __SYCL_DEVICE_ONLY__
103 void __init([[__sycl_detail__::add_ir_attributes_kernel_parameter(
125 template <
typename... PropertyValueTs>
127 static constexpr
bool has_same_properties = std::is_same<
133 "The property list must contain all properties of the input of the "
141 template <
typename T2,
typename PropertyList2>
144 static constexpr
bool is_input_convertible =
145 std::is_convertible<T2, T *>::value;
146 static_assert(is_input_convertible,
147 "The underlying data type of the input annotated_arg is not "
150 static constexpr
bool has_same_properties = std::is_same<
155 "The constructed annotated_arg type must contain all the properties "
156 "of the input annotated_arg");
163 template <
typename T2,
typename PropertyListU,
typename PropertyListV>
165 const PropertyListV &proplist)
noexcept
168 static constexpr
bool is_input_convertible =
169 std::is_convertible<T2, T *>::value;
170 static_assert(is_input_convertible,
171 "The underlying data type of the input annotated_arg is not "
174 static constexpr
bool has_same_properties = std::is_same<
179 "The property list of constructed annotated_arg type must be the union "
180 "of the input property lists");
191 return property_list_t::template has_property<PropertyT>();
195 return property_list_t::template get_property<PropertyT>();
212 "The property list contains invalid property.");
217 "FPGA Interface properties (i.e. awidth, dwidth, etc.) "
218 "can only be set with BufferLocation together.");
223 "The properties conduit and register_map cannot be "
224 "specified at the same time.");
228 template <
typename T,
typename... Props>
234 template <
typename T2,
typename PropertyListT>
friend class annotated_arg;
238 #ifdef __SYCL_DEVICE_ONLY__
239 void __init([[__sycl_detail__::add_ir_attributes_kernel_parameter(
261 template <
typename... PropertyValueTs>
263 static constexpr
bool has_same_properties = std::is_same<
269 "The property list must contain all properties of the input of the "
277 template <
typename T2,
typename PropertyList2>
280 static constexpr
bool is_input_convertible =
281 std::is_convertible<T2, T>::value;
282 static_assert(is_input_convertible,
283 "The underlying data type of the input annotated_arg is not "
286 static constexpr
bool has_same_properties = std::is_same<
288 detail::merged_properties_t<property_list_t, PropertyList2>>::value;
291 "The constructed annotated_arg type must contain all the properties "
292 "of the input annotated_arg");
299 template <
typename T2,
typename PropertyListU,
typename PropertyListV>
300 explicit annotated_arg(
const annotated_arg<T2, PropertyListU> &other,
301 const PropertyListV &proplist)
noexcept
304 static constexpr
bool is_input_convertible =
305 std::is_convertible<T2, T>::value;
306 static_assert(is_input_convertible,
307 "The underlying data type of the input annotated_arg is not "
310 static constexpr
bool has_same_properties = std::is_same<
312 detail::merged_properties_t<PropertyListU, PropertyListV>>::value;
315 "The property list of constructed annotated_arg type must be the union "
316 "of the input property lists");
322 template <
class RelayT = T>
323 std::enable_if_t<detail::HasSubscriptOperator<RelayT>::value,
324 decltype(std::declval<RelayT>().
operator[](0))> &
326 return obj.operator[](idx);
329 template <
typename PropertyT>
static constexpr
bool has_property() {
330 return property_list_t::template has_property<PropertyT>();
333 template <
typename PropertyT>
static constexpr
auto get_property() {
334 return property_list_t::template get_property<PropertyT>();
338 #define PROPAGATE_OP(op) \
339 template <class O> friend auto operator op(O &&a, const annotated_arg &b) { \
340 if constexpr (!detail::is_ann_arg_v<O>) \
341 return std::forward<O>(a) op b.operator T(); \
343 return a.operator detail::GetUnderlyingT<O>() op b.operator T(); \
345 template <class O, typename = std::enable_if_t<!detail::is_ann_arg_v<O>>> \
346 friend auto operator op(const annotated_arg &a, O &&b) \
347 -> decltype(std::declval<T>() op std::forward<O>(b)) { \
348 return a.operator T() op std::forward<O>(b); \
372 #define PROPAGATE_OP(op) \
373 template <typename O = T> \
374 auto operator op() const -> decltype(op std::declval<O>()) { \
375 return op this->operator O(); \
396 has_property<buffer_location_key>();
398 "Property buffer_location cannot be specified for "
399 "annotated_arg<T> when T is a non pointer type.");
401 static constexpr
bool has_awidth = has_property<awidth_key>();
402 static_assert(!
has_awidth,
"Property awidth cannot be specified for "
403 "annotated_arg<T> when T is a non pointer type.");
405 static constexpr
bool has_dwidth = has_property<dwidth_key>();
406 static_assert(!
has_dwidth,
"Property dwidth cannot be specified for "
407 "annotated_arg<T> when T is a non pointer type.");
410 static_assert(!
has_latency,
"Property latency cannot be specified for "
411 "annotated_arg<T> when T is a non pointer type.");
414 has_property<read_write_mode_key>();
416 "Property read_write_mode cannot be specified for "
417 "annotated_arg<T> when T is a non pointer type.");
421 "Property maxburst cannot be specified for "
422 "annotated_arg<T> when T is a non pointer type.");
426 "Property wait_request cannot be specified for "
427 "annotated_arg<T> when T is a non pointer type.");
431 "Property alignment cannot be specified for "
432 "annotated_arg<T> when T is a non pointer type.");
436 "Property usm_kind cannot be specified for "
437 "annotated_arg<T> when T is a non pointer type.");
445 "The property list contains invalid property.");
450 "FPGA Interface properties (i.e. awidth, dwidth, etc.) "
451 "can only be set with BufferLocation together.");
456 "The properties conduit and register_map cannot be "
457 "specified at the same time.");
#define __SYCL_SPECIAL_CLASS
typename GetUnderlyingTImpl< std::remove_cv_t< std::remove_reference_t< T > >>::type GetUnderlyingT
typename merged_properties< LHSPropertiesT, RHSPropertiesT >::type merged_properties_t
properties< std::tuple< PropertyValueTs... > > properties_t
constexpr bool is_ann_arg_v
friend class annotated_arg
static constexpr bool has_alignment
annotated_arg(const T &_obj, PropertyValueTs... props) noexcept
static constexpr bool has_property()
static constexpr bool hasValidFPGAProperties
class __SYCL_SPECIAL_CLASS __SYCL_TYPE(annotated_arg) annotated_arg< T *
static constexpr bool has_usm_kind
static constexpr bool is_valid_property_list
static constexpr bool has_awidth
static constexpr bool has_buffer_location
static constexpr bool has_wait_request
static constexpr auto get_property()
detail::properties_t< Props... > property_list_t
static constexpr bool contains_valid_properties
T * operator->() const noexcept
T & operator[](std::ptrdiff_t idx) const noexcept
static constexpr bool has_dwidth
static constexpr bool has_latency
static constexpr bool has_maxburst
static constexpr bool hasConduitAndRegisterMapProperties
static constexpr bool has_read_write_mode
typename decorated_global_ptr< T >::pointer global_pointer_t
_Abi const simd< _Tp, _Abi > & noexcept
is_device_copyable is a user specializable class template to indicate that a type T is device copyabl...