19 #include <type_traits>
26 template <
typename T,
typename PropertyList>
31 inline namespace _V1 {
34 namespace experimental {
42 !std::is_void_v<decltype(std::declval<T>().operator[](0))>> {};
45 template <
class T,
class P>
47 template <
class T,
class P>
59 std::remove_cv_t<std::remove_reference_t<T>>>::type;
64 template <
typename T,
typename... Args>
68 template <
typename T,
typename old,
typename... ArgT>
73 template <
typename T,
typename PropertyListT = empty_properties_t>
76 static constexpr
bool is_valid_property_list =
82 template <
typename T,
typename... Props>
89 template <
typename T2,
typename PropertyListT>
friend class annotated_arg;
91 #ifdef __ENABLE_USM_ADDR_SPACE__
103 #ifdef __SYCL_DEVICE_ONLY__
104 void __init([[__sycl_detail__::add_ir_attributes_kernel_parameter(
126 template <
typename... PropertyValueTs>
128 static constexpr
bool has_same_properties = std::is_same<
134 "The property list must contain all properties of the input of the "
142 template <
typename T2,
typename PropertyList2>
145 static constexpr
bool is_input_convertible =
146 std::is_convertible<T2, T *>::value;
147 static_assert(is_input_convertible,
148 "The underlying data type of the input annotated_arg is not "
151 static constexpr
bool has_same_properties = std::is_same<
156 "The constructed annotated_arg type must contain all the properties "
157 "of the input annotated_arg");
164 template <
typename T2,
typename PropertyListU,
typename PropertyListV>
166 const PropertyListV &proplist)
noexcept
169 static constexpr
bool is_input_convertible =
170 std::is_convertible<T2, T *>::value;
171 static_assert(is_input_convertible,
172 "The underlying data type of the input annotated_arg is not "
175 static constexpr
bool has_same_properties = std::is_same<
180 "The property list of constructed annotated_arg type must be the union "
181 "of the input property lists");
192 return property_list_t::template has_property<PropertyT>();
196 return property_list_t::template get_property<PropertyT>();
213 "The property list contains invalid property.");
218 "FPGA Interface properties (i.e. awidth, dwidth, etc.) "
219 "can only be set with BufferLocation together.");
224 "The properties conduit and register_map cannot be "
225 "specified at the same time.");
229 template <
typename T,
typename... Props>
235 template <
typename T2,
typename PropertyListT>
friend class annotated_arg;
239 #ifdef __SYCL_DEVICE_ONLY__
240 void __init([[__sycl_detail__::add_ir_attributes_kernel_parameter(
262 template <
typename... PropertyValueTs>
264 static constexpr
bool has_same_properties = std::is_same<
270 "The property list must contain all properties of the input of the "
278 template <
typename T2,
typename PropertyList2>
281 static constexpr
bool is_input_convertible =
282 std::is_convertible<T2, T>::value;
283 static_assert(is_input_convertible,
284 "The underlying data type of the input annotated_arg is not "
287 static constexpr
bool has_same_properties = std::is_same<
289 detail::merged_properties_t<property_list_t, PropertyList2>>::value;
292 "The constructed annotated_arg type must contain all the properties "
293 "of the input annotated_arg");
300 template <
typename T2,
typename PropertyListU,
typename PropertyListV>
301 explicit annotated_arg(
const annotated_arg<T2, PropertyListU> &other,
302 const PropertyListV &proplist)
noexcept
305 static constexpr
bool is_input_convertible =
306 std::is_convertible<T2, T>::value;
307 static_assert(is_input_convertible,
308 "The underlying data type of the input annotated_arg is not "
311 static constexpr
bool has_same_properties = std::is_same<
313 detail::merged_properties_t<PropertyListU, PropertyListV>>::value;
316 "The property list of constructed annotated_arg type must be the union "
317 "of the input property lists");
323 template <
class RelayT = T>
324 std::enable_if_t<detail::HasSubscriptOperator<RelayT>::value,
325 decltype(std::declval<RelayT>().
operator[](0))> &
327 return obj.operator[](idx);
330 template <
typename PropertyT>
static constexpr
bool has_property() {
331 return property_list_t::template has_property<PropertyT>();
334 template <
typename PropertyT>
static constexpr
auto get_property() {
335 return property_list_t::template get_property<PropertyT>();
339 #define PROPAGATE_OP(op) \
340 template <class O> friend auto operator op(O &&a, const annotated_arg &b) { \
341 if constexpr (!detail::is_ann_arg_v<O>) \
342 return std::forward<O>(a) op b.operator T(); \
344 return a.operator detail::GetUnderlyingT<O>() op b.operator T(); \
346 template <class O, typename = std::enable_if_t<!detail::is_ann_arg_v<O>>> \
347 friend auto operator op(const annotated_arg &a, O &&b) \
348 -> decltype(std::declval<T>() op std::forward<O>(b)) { \
349 return a.operator T() op std::forward<O>(b); \
373 #define PROPAGATE_OP(op) \
374 template <typename O = T> \
375 auto operator op() const -> decltype(op std::declval<O>()) { \
376 return op this->operator O(); \
397 has_property<buffer_location_key>();
399 "Property buffer_location cannot be specified for "
400 "annotated_arg<T> when T is a non pointer type.");
402 static constexpr
bool has_awidth = has_property<awidth_key>();
403 static_assert(!
has_awidth,
"Property awidth cannot be specified for "
404 "annotated_arg<T> when T is a non pointer type.");
406 static constexpr
bool has_dwidth = has_property<dwidth_key>();
407 static_assert(!
has_dwidth,
"Property dwidth cannot be specified for "
408 "annotated_arg<T> when T is a non pointer type.");
411 static_assert(!
has_latency,
"Property latency cannot be specified for "
412 "annotated_arg<T> when T is a non pointer type.");
415 has_property<read_write_mode_key>();
417 "Property read_write_mode cannot be specified for "
418 "annotated_arg<T> when T is a non pointer type.");
422 "Property maxburst cannot be specified for "
423 "annotated_arg<T> when T is a non pointer type.");
427 "Property wait_request cannot be specified for "
428 "annotated_arg<T> when T is a non pointer type.");
432 "Property alignment cannot be specified for "
433 "annotated_arg<T> when T is a non pointer type.");
437 "Property usm_kind cannot be specified for "
438 "annotated_arg<T> when T is a non pointer type.");
446 "The property list contains invalid property.");
451 "FPGA Interface properties (i.e. awidth, dwidth, etc.) "
452 "can only be set with BufferLocation together.");
457 "The properties conduit and register_map cannot be "
458 "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...