Skip to content

Commit 33a2557

Browse files
committed
small fixes
1 parent 5ab61cf commit 33a2557

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

sycl/include/sycl/ext/oneapi/annotated_arg/annotated_arg.hpp

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
Op " is not supported on host device.");
2626
#endif
2727

28+
2829
#ifdef __SYCL_DEVICE_ONLY__
2930
#define __OPENCL_GLOBAL_AS__ __attribute__((opencl_global))
3031
#ifdef __ENABLE_USM_ADDR_SPACE__
@@ -75,11 +76,11 @@ struct HasSubscriptOperator<
7576
template <typename T, typename... Args>
7677
annotated_arg(T, Args... args) -> annotated_arg<T, detail::properties_t<Args...>, std::is_pointer<T>::value>;
7778

78-
// template <typename T, typename... Args>
79-
// annotated_arg(T, properties<std::tuple<Args...>>) -> annotated_arg<T, detail::properties_t<Args...>, std::is_pointer<T>::value>;
79+
template <typename T, typename... Args>
80+
annotated_arg(T, properties<std::tuple<Args...>>) -> annotated_arg<T, detail::properties_t<Args...>, std::is_pointer<T>::value>;
8081

81-
template <typename T, typename old, typename ArgT, bool IsPtr>
82-
annotated_arg(annotated_arg<T, old, IsPtr>, ArgT newp) -> annotated_arg<T, detail::merged_properties_t<old, ArgT>, IsPtr>;
82+
template <typename T, typename old, typename... ArgT, bool IsPtr>
83+
annotated_arg(annotated_arg<T, old, IsPtr>, properties<std::tuple<ArgT...>>) -> annotated_arg<T, detail::merged_properties_t<old, detail::properties_t<ArgT...>>, IsPtr>;
8384

8485
template <typename T, typename PropertyListT = detail::empty_properties_t, bool IsPtr = std::is_pointer<T>::value>
8586
class annotated_arg {
@@ -116,16 +117,18 @@ class __SYCL_SPECIAL_CLASS __SYCL_TYPE(annotated_arg) annotated_arg<T, detail::p
116117
// "Property list is invalid.");
117118
static_assert(check_property_list<T, Props...>::value,
118119
"The property list contains invalid property.");
120+
static_assert(detail::SortedAllUnique<std::tuple<Props...>>::value,
121+
"Duplicate properties in property list.");
119122

120123
annotated_arg() noexcept = default;
121124
annotated_arg(const annotated_arg&) = default;
122125
annotated_arg& operator=(annotated_arg&) = default;
123126

124-
// explicit annotated_arg(const T& _ptr, const property_list_t &PropList = properties{}) noexcept
125-
// : obj((__OPENCL_GLOBAL_AS__ UnderlyingT*)_ptr) {}
127+
annotated_arg(const T& _ptr, const property_list_t &PropList = properties{}) noexcept
128+
: obj((__OPENCL_GLOBAL_AS__ UnderlyingT*)_ptr) {}
126129

127130
template<typename... PropertyValueTs>
128-
explicit annotated_arg(const T& _ptr, PropertyValueTs... props) noexcept : obj((__OPENCL_GLOBAL_AS__ UnderlyingT*)_ptr) {
131+
annotated_arg(const T& _ptr, PropertyValueTs... props) noexcept : obj((__OPENCL_GLOBAL_AS__ UnderlyingT*)_ptr) {
129132
static_assert(
130133
std::is_same<
131134
property_list_t,
@@ -223,10 +226,10 @@ class __SYCL_SPECIAL_CLASS __SYCL_TYPE(annotated_arg) annotated_arg <T, detail::
223226
annotated_arg(const annotated_arg&) = default;
224227
annotated_arg& operator=(annotated_arg&) = default;
225228

226-
explicit annotated_arg(const T& _obj, const property_list_t &PropList = properties{}) noexcept : obj(_obj) {}
229+
annotated_arg(const T& _obj, const property_list_t &PropList = properties{}) noexcept : obj(_obj) {}
227230

228231
template<typename... PropertyValueTs>
229-
explicit annotated_arg(const T& _obj, PropertyValueTs... props) noexcept : obj(_obj) {
232+
annotated_arg(const T& _obj, PropertyValueTs... props) noexcept : obj(_obj) {
230233
static_assert(
231234
std::is_same<
232235
property_list_t,

0 commit comments

Comments
 (0)