Skip to content

Commit 972fd2d

Browse files
committed
Fix most tests
1 parent c14ad30 commit 972fd2d

25 files changed

+117
-430
lines changed

sycl/include/sycl/ext/intel/esimd/memory_properties.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -312,8 +312,8 @@ struct property_value<__ESIMD_NS::cache_hint_L3_key,
312312

313313
// Declare that esimd::properties is a property_list.
314314
template <typename... PropertyValueTs>
315-
struct is_property_list<__ESIMD_NS::properties<std::tuple<PropertyValueTs...>>>
316-
: is_property_list<properties<std::tuple<PropertyValueTs...>>> {};
315+
struct is_property_list<__ESIMD_NS::properties<detail::type_list<PropertyValueTs...>>>
316+
: is_property_list<properties<detail::type_list<PropertyValueTs...>>> {};
317317

318318
namespace detail {
319319
// We do not override the class ConflictingProperties for cache_hint properties

sycl/include/sycl/ext/intel/experimental/fpga_annotated_properties.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ struct propagateToPtrAnnotation<buffer_location_key> : std::true_type {};
320320
//
321321
namespace detail {
322322
template <typename... Args> struct checkValidFPGAPropertySet {
323-
using list = std::tuple<Args...>;
323+
using list = detail::type_list<Args...>;
324324
static constexpr bool has_BufferLocation =
325325
ContainsProperty<buffer_location_key, list>::value;
326326

@@ -336,7 +336,7 @@ template <typename... Args> struct checkValidFPGAPropertySet {
336336
};
337337

338338
template <typename... Args> struct checkHasConduitAndRegisterMap {
339-
using list = std::tuple<Args...>;
339+
using list = detail::type_list<Args...>;
340340
static constexpr bool has_Conduit =
341341
ContainsProperty<conduit_key, list>::value;
342342
static constexpr bool has_RegisterMap =

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ annotated_arg(T, Args...)
6666
-> annotated_arg<T, typename detail::DeducedProperties<Args...>::type>;
6767

6868
template <typename T, typename old, typename... ArgT>
69-
annotated_arg(annotated_arg<T, old>, properties<std::tuple<ArgT...>>)
69+
annotated_arg(annotated_arg<T, old>, detail::properties_t<ArgT...>)
7070
-> annotated_arg<
7171
T, detail::merged_properties_t<old, detail::properties_t<ArgT...>>>;
7272

@@ -114,7 +114,7 @@ __SYCL_TYPE(annotated_arg) annotated_arg<T *, detail::properties_t<Props...>> {
114114
annotated_arg &operator=(annotated_arg &) = default;
115115

116116
annotated_arg(T *_ptr,
117-
const property_list_t &PropList = properties{}) noexcept
117+
const property_list_t &PropList = property_list_t{}) noexcept
118118
: obj(_ptr) {
119119
(void)PropList;
120120
}
@@ -250,7 +250,7 @@ __SYCL_TYPE(annotated_arg) annotated_arg<T, detail::properties_t<Props...>> {
250250
annotated_arg &operator=(annotated_arg &) = default;
251251

252252
annotated_arg(const T &_obj,
253-
const property_list_t &PropList = properties{}) noexcept
253+
const property_list_t &PropList = property_list_t{}) noexcept
254254
: obj(_obj) {
255255
(void)PropList;
256256
}

sycl/include/sycl/ext/oneapi/experimental/annotated_ptr/annotated_ptr.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ constexpr bool is_ann_ref_v =
5252

5353
template <typename... Ts>
5454
using contains_alignment =
55-
detail::ContainsProperty<alignment_key, std::tuple<Ts...>>;
55+
detail::ContainsProperty<alignment_key, detail::type_list<Ts...>>;
5656

5757
// properties filter
5858
template <typename property_list, template <class...> typename filter>
@@ -62,7 +62,7 @@ using PropertiesFilter =
6262
// filter properties that are applied on annotations
6363
template <typename... Props>
6464
using annotation_filter = properties<
65-
PropertiesFilter<std::tuple<Props...>, propagateToPtrAnnotation>>;
65+
PropertiesFilter<detail::type_list<Props...>, propagateToPtrAnnotation>>;
6666
} // namespace detail
6767

6868
template <typename I, typename P> struct annotationHelper {};
@@ -245,7 +245,7 @@ annotated_ptr(T *, Args...)
245245
-> annotated_ptr<T, typename detail::DeducedProperties<Args...>::type>;
246246

247247
template <typename T, typename old, typename... ArgT>
248-
annotated_ptr(annotated_ptr<T, old>, properties<std::tuple<ArgT...>>)
248+
annotated_ptr(annotated_ptr<T, old>, detail::properties_t<ArgT...>)
249249
-> annotated_ptr<
250250
T, detail::merged_properties_t<old, detail::properties_t<ArgT...>>>;
251251
#endif // __cpp_deduction_guides

sycl/include/sycl/ext/oneapi/experimental/annotated_ptr/annotated_ptr_properties.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,19 +59,19 @@ template <typename PropertyListT> struct IsUsmKindDevice : std::false_type {};
5959
template <typename... Props>
6060
struct IsUsmKindDevice<detail::properties_t<Props...>>
6161
: detail::ContainsProperty<std::remove_const_t<decltype(usm_kind_device)>,
62-
std::tuple<Props...>> {};
62+
detail::type_list<Props...>> {};
6363

6464
template <typename PropertyListT> struct IsUsmKindHost : std::false_type {};
6565
template <typename... Props>
6666
struct IsUsmKindHost<detail::properties_t<Props...>>
6767
: detail::ContainsProperty<std::remove_const_t<decltype(usm_kind_host)>,
68-
std::tuple<Props...>> {};
68+
detail::type_list<Props...>> {};
6969

7070
template <typename PropertyListT> struct IsUsmKindShared : std::false_type {};
7171
template <typename... Props>
7272
struct IsUsmKindShared<detail::properties_t<Props...>>
7373
: detail::ContainsProperty<std::remove_const_t<decltype(usm_kind_shared)>,
74-
std::tuple<Props...>> {};
74+
detail::type_list<Props...>> {};
7575

7676
} // namespace detail
7777

sycl/include/sycl/ext/oneapi/experimental/annotated_usm/alloc_base.hpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ std::enable_if_t<
4444
aligned_alloc_annotated(size_t alignment, size_t numBytes,
4545
const device &syclDevice, const context &syclContext,
4646
sycl::usm::alloc kind,
47-
const propertyListA &propList = properties{}) {
47+
const propertyListA &propList = propertyListA{}) {
4848
detail::ValidAllocPropertyList<void, propertyListA>::value;
4949

5050
// The input argument `propList` is useful when propertyListA contains valid
@@ -86,7 +86,7 @@ std::enable_if_t<
8686
aligned_alloc_annotated(size_t alignment, size_t count,
8787
const device &syclDevice, const context &syclContext,
8888
sycl::usm::alloc kind,
89-
const propertyListA &propList = properties{}) {
89+
const propertyListA &propList = propertyListA{}) {
9090
detail::ValidAllocPropertyList<T, propertyListA>::value;
9191

9292
// The input argument `propList` is useful when propertyListA contains valid
@@ -127,7 +127,7 @@ std::enable_if_t<
127127
annotated_ptr<void, propertyListB>>
128128
aligned_alloc_annotated(size_t alignment, size_t numBytes,
129129
const queue &syclQueue, sycl::usm::alloc kind,
130-
const propertyListA &propList = properties{}) {
130+
const propertyListA &propList = propertyListA{}) {
131131
return aligned_alloc_annotated(alignment, numBytes, syclQueue.get_device(),
132132
syclQueue.get_context(), kind, propList);
133133
}
@@ -140,7 +140,7 @@ std::enable_if_t<
140140
annotated_ptr<T, propertyListB>>
141141
aligned_alloc_annotated(size_t alignment, size_t count, const queue &syclQueue,
142142
sycl::usm::alloc kind,
143-
const propertyListA &propList = properties{}) {
143+
const propertyListA &propList = propertyListA{}) {
144144
return aligned_alloc_annotated<T>(alignment, count, syclQueue.get_device(),
145145
syclQueue.get_context(), kind, propList);
146146
}
@@ -153,7 +153,7 @@ std::enable_if_t<
153153
annotated_ptr<void, propertyListB>>
154154
malloc_annotated(size_t numBytes, const device &syclDevice,
155155
const context &syclContext, sycl::usm::alloc kind,
156-
const propertyListA &propList = properties{}) {
156+
const propertyListA &propList = propertyListA{}) {
157157
return aligned_alloc_annotated(0, numBytes, syclDevice, syclContext, kind,
158158
propList);
159159
}
@@ -166,7 +166,7 @@ std::enable_if_t<
166166
annotated_ptr<T, propertyListB>>
167167
malloc_annotated(size_t count, const device &syclDevice,
168168
const context &syclContext, sycl::usm::alloc kind,
169-
const propertyListA &propList = properties{}) {
169+
const propertyListA &propList = propertyListA{}) {
170170
return aligned_alloc_annotated<T>(0, count, syclDevice, syclContext, kind,
171171
propList);
172172
}
@@ -178,7 +178,7 @@ std::enable_if_t<
178178
detail::CheckTAndPropLists<void, propertyListA, propertyListB>::value,
179179
annotated_ptr<void, propertyListB>>
180180
malloc_annotated(size_t numBytes, const queue &syclQueue, sycl::usm::alloc kind,
181-
const propertyListA &propList = properties{}) {
181+
const propertyListA &propList = propertyListA{}) {
182182
return malloc_annotated(numBytes, syclQueue.get_device(),
183183
syclQueue.get_context(), kind, propList);
184184
}
@@ -190,7 +190,7 @@ std::enable_if_t<
190190
detail::CheckTAndPropLists<T, propertyListA, propertyListB>::value,
191191
annotated_ptr<T, propertyListB>>
192192
malloc_annotated(size_t count, const queue &syclQueue, sycl::usm::alloc kind,
193-
const propertyListA &propList = properties{}) {
193+
const propertyListA &propList = propertyListA{}) {
194194
return malloc_annotated<T>(count, syclQueue.get_device(),
195195
syclQueue.get_context(), kind, propList);
196196
}

sycl/include/sycl/ext/oneapi/experimental/annotated_usm/alloc_device.hpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ std::enable_if_t<
4646
aligned_alloc_device_annotated(size_t alignment, size_t numBytes,
4747
const device &syclDevice,
4848
const context &syclContext,
49-
const propertyListA &propList = properties{}) {
49+
const propertyListA &propList = propertyListA{}) {
5050
auto tmp =
5151
aligned_alloc_annotated(alignment, numBytes, syclDevice, syclContext,
5252
sycl::usm::alloc::device, propList);
@@ -62,7 +62,7 @@ std::enable_if_t<
6262
aligned_alloc_device_annotated(size_t alignment, size_t count,
6363
const device &syclDevice,
6464
const context &syclContext,
65-
const propertyListA &propList = properties{}) {
65+
const propertyListA &propList = propertyListA{}) {
6666
auto tmp =
6767
aligned_alloc_annotated<T>(alignment, count, syclDevice, syclContext,
6868
sycl::usm::alloc::device, propList);
@@ -77,7 +77,7 @@ std::enable_if_t<
7777
annotated_ptr<void, propertyListB>>
7878
aligned_alloc_device_annotated(size_t alignment, size_t numBytes,
7979
const queue &syclQueue,
80-
const propertyListA &propList = properties{}) {
80+
const propertyListA &propList = propertyListA{}) {
8181
return aligned_alloc_device_annotated(alignment, numBytes,
8282
syclQueue.get_device(),
8383
syclQueue.get_context(), propList);
@@ -91,7 +91,7 @@ std::enable_if_t<
9191
annotated_ptr<T, propertyListB>>
9292
aligned_alloc_device_annotated(size_t alignment, size_t count,
9393
const queue &syclQueue,
94-
const propertyListA &propList = properties{}) {
94+
const propertyListA &propList = propertyListA{}) {
9595
return aligned_alloc_device_annotated<T>(alignment, count,
9696
syclQueue.get_device(),
9797
syclQueue.get_context(), propList);
@@ -112,7 +112,7 @@ std::enable_if_t<
112112
annotated_ptr<void, propertyListB>>
113113
malloc_device_annotated(size_t numBytes, const device &syclDevice,
114114
const context &syclContext,
115-
const propertyListA &propList = properties{}) {
115+
const propertyListA &propList = propertyListA{}) {
116116
return aligned_alloc_device_annotated(0, numBytes, syclDevice, syclContext,
117117
propList);
118118
}
@@ -125,7 +125,7 @@ std::enable_if_t<
125125
annotated_ptr<T, propertyListB>>
126126
malloc_device_annotated(size_t count, const device &syclDevice,
127127
const context &syclContext,
128-
const propertyListA &propList = properties{}) {
128+
const propertyListA &propList = propertyListA{}) {
129129
return aligned_alloc_device_annotated<T>(0, count, syclDevice, syclContext,
130130
propList);
131131
}
@@ -137,7 +137,7 @@ std::enable_if_t<
137137
CheckDevicePtrTAndPropLists<void, propertyListA, propertyListB>::value,
138138
annotated_ptr<void, propertyListB>>
139139
malloc_device_annotated(size_t numBytes, const queue &syclQueue,
140-
const propertyListA &propList = properties{}) {
140+
const propertyListA &propList = propertyListA{}) {
141141
return malloc_device_annotated(numBytes, syclQueue.get_device(),
142142
syclQueue.get_context(), propList);
143143
}
@@ -149,7 +149,7 @@ std::enable_if_t<
149149
CheckDevicePtrTAndPropLists<T, propertyListA, propertyListB>::value,
150150
annotated_ptr<T, propertyListB>>
151151
malloc_device_annotated(size_t count, const queue &syclQueue,
152-
const propertyListA &propList = properties{}) {
152+
const propertyListA &propList = propertyListA{}) {
153153
return malloc_device_annotated<T>(count, syclQueue.get_device(),
154154
syclQueue.get_context(), propList);
155155
}

sycl/include/sycl/ext/oneapi/experimental/annotated_usm/alloc_shared.hpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ std::enable_if_t<
4646
aligned_alloc_shared_annotated(size_t alignment, size_t numBytes,
4747
const device &syclDevice,
4848
const context &syclContext,
49-
const propertyListA &propList = properties{}) {
49+
const propertyListA &propList = propertyListA{}) {
5050
auto tmp =
5151
aligned_alloc_annotated(alignment, numBytes, syclDevice, syclContext,
5252
sycl::usm::alloc::shared, propList);
@@ -62,7 +62,7 @@ std::enable_if_t<
6262
aligned_alloc_shared_annotated(size_t alignment, size_t count,
6363
const device &syclDevice,
6464
const context &syclContext,
65-
const propertyListA &propList = properties{}) {
65+
const propertyListA &propList = propertyListA{}) {
6666
auto tmp =
6767
aligned_alloc_annotated<T>(alignment, count, syclDevice, syclContext,
6868
sycl::usm::alloc::shared, propList);
@@ -77,7 +77,7 @@ std::enable_if_t<
7777
annotated_ptr<void, propertyListB>>
7878
aligned_alloc_shared_annotated(size_t alignment, size_t numBytes,
7979
const queue &syclQueue,
80-
const propertyListA &propList = properties{}) {
80+
const propertyListA &propList = propertyListA{}) {
8181
return aligned_alloc_shared_annotated(alignment, numBytes,
8282
syclQueue.get_device(),
8383
syclQueue.get_context(), propList);
@@ -91,7 +91,7 @@ std::enable_if_t<
9191
annotated_ptr<T, propertyListB>>
9292
aligned_alloc_shared_annotated(size_t alignment, size_t count,
9393
const queue &syclQueue,
94-
const propertyListA &propList = properties{}) {
94+
const propertyListA &propList = propertyListA{}) {
9595
return aligned_alloc_shared_annotated<T>(alignment, count,
9696
syclQueue.get_device(),
9797
syclQueue.get_context(), propList);
@@ -112,7 +112,7 @@ std::enable_if_t<
112112
annotated_ptr<void, propertyListB>>
113113
malloc_shared_annotated(size_t numBytes, const device &syclDevice,
114114
const context &syclContext,
115-
const propertyListA &propList = properties{}) {
115+
const propertyListA &propList = propertyListA{}) {
116116
return aligned_alloc_shared_annotated(0, numBytes, syclDevice, syclContext,
117117
propList);
118118
}
@@ -125,7 +125,7 @@ std::enable_if_t<
125125
annotated_ptr<T, propertyListB>>
126126
malloc_shared_annotated(size_t count, const device &syclDevice,
127127
const context &syclContext,
128-
const propertyListA &propList = properties{}) {
128+
const propertyListA &propList = propertyListA{}) {
129129
return aligned_alloc_shared_annotated<T>(0, count, syclDevice, syclContext,
130130
propList);
131131
}
@@ -137,7 +137,7 @@ std::enable_if_t<
137137
CheckSharedPtrTAndPropLists<void, propertyListA, propertyListB>::value,
138138
annotated_ptr<void, propertyListB>>
139139
malloc_shared_annotated(size_t numBytes, const queue &syclQueue,
140-
const propertyListA &propList = properties{}) {
140+
const propertyListA &propList = propertyListA{}) {
141141
return malloc_shared_annotated(numBytes, syclQueue.get_device(),
142142
syclQueue.get_context(), propList);
143143
}
@@ -149,7 +149,7 @@ std::enable_if_t<
149149
CheckSharedPtrTAndPropLists<T, propertyListA, propertyListB>::value,
150150
annotated_ptr<T, propertyListB>>
151151
malloc_shared_annotated(size_t count, const queue &syclQueue,
152-
const propertyListA &propList = properties{}) {
152+
const propertyListA &propList = propertyListA{}) {
153153
return malloc_shared_annotated<T>(count, syclQueue.get_device(),
154154
syclQueue.get_context(), propList);
155155
}

sycl/include/sycl/ext/oneapi/experimental/annotated_usm/alloc_util.hpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ template <typename PropKey, typename PropertyListT> struct HasProperty {};
3636

3737
template <typename PropKey, typename... Props>
3838
struct HasProperty<PropKey, detail::properties_t<Props...>>
39-
: detail::ContainsProperty<PropKey, std::tuple<Props...>> {};
39+
: detail::ContainsProperty<PropKey, detail::type_list<Props...>> {};
4040

4141
template <typename PropertyListT>
4242
using HasAlign = HasProperty<alignment_key, PropertyListT>;
@@ -49,10 +49,9 @@ using HasBufferLocation = HasProperty<buffer_location_key, PropertyListT>;
4949
template <typename PropKey, typename ConstType, typename DefaultPropVal,
5050
typename PropertyListT>
5151
struct GetPropertyValueFromPropList {
52-
using prop_val_t =
53-
decltype(detail::ValueOrDefault<PropertyListT, PropKey>::get(
54-
DefaultPropVal()));
55-
static constexpr ConstType value =
52+
using V = detail::mp11::mp_map_find<detail::mp11::mp_first<PropertyListT>, PropKey>;
53+
using prop_val_t = detail::mp11::mp_if<std::is_same<V, void>, DefaultPropVal, V>;
54+
static constexpr ConstType value =
5655
detail::PropertyMetaInfo<std::remove_const_t<prop_val_t>>::value;
5756
};
5857

0 commit comments

Comments
 (0)