@@ -41,9 +41,8 @@ template <typename propertyListA = empty_properties_t,
4141std::enable_if_t <
4242 detail::CheckTAndPropLists<void , propertyListA, propertyListB>::value,
4343 annotated_ptr<void , propertyListB>>
44- aligned_alloc_annotated (size_t alignment, size_t numBytes,
45- const device &syclDevice, const context &syclContext,
46- sycl::usm::alloc kind,
44+ aligned_alloc_annotated (size_t align, size_t numBytes, const device &syclDevice,
45+ const context &syclContext, sycl::usm::alloc kind,
4746 const propertyListA &propList = propertyListA{}) {
4847 detail::ValidAllocPropertyList<void , propertyListA>::value;
4948
@@ -53,12 +52,12 @@ aligned_alloc_annotated(size_t alignment, size_t numBytes,
5352 static_cast <void >(propList);
5453
5554 constexpr size_t alignFromPropList =
56- detail::GetAlignFromPropList< propertyListA>:: value;
55+ detail::get_property_or<alignment_key, propertyListA>(alignment< 0 >). value ;
5756 const property_list &usmPropList = get_usm_property_list<propertyListA>();
5857
59- if constexpr (detail::HasUsmKind<propertyListA>::value ) {
58+ if constexpr (propertyListA:: template has_property<usm_kind_key>() ) {
6059 constexpr sycl::usm::alloc usmKind =
61- detail::GetUsmKindFromPropList<propertyListA>:: value;
60+ propertyListA:: template get_property<usm_kind_key>(). value ;
6261 if (usmKind != kind) {
6362 throw sycl::exception (
6463 sycl::make_error_code (sycl::errc::invalid),
@@ -72,7 +71,7 @@ aligned_alloc_annotated(size_t alignment, size_t numBytes,
7271 " Unknown USM allocation kind was specified." );
7372
7473 void *rawPtr =
75- sycl::aligned_alloc (combine_align (alignment , alignFromPropList), numBytes,
74+ sycl::aligned_alloc (combine_align (align , alignFromPropList), numBytes,
7675 syclDevice, syclContext, kind, usmPropList);
7776 return annotated_ptr<void , propertyListB>(rawPtr);
7877}
@@ -83,9 +82,8 @@ template <typename T, typename propertyListA = empty_properties_t,
8382std::enable_if_t <
8483 detail::CheckTAndPropLists<T, propertyListA, propertyListB>::value,
8584 annotated_ptr<T, propertyListB>>
86- aligned_alloc_annotated (size_t alignment, size_t count,
87- const device &syclDevice, const context &syclContext,
88- sycl::usm::alloc kind,
85+ aligned_alloc_annotated (size_t align, size_t count, const device &syclDevice,
86+ const context &syclContext, sycl::usm::alloc kind,
8987 const propertyListA &propList = propertyListA{}) {
9088 detail::ValidAllocPropertyList<T, propertyListA>::value;
9189
@@ -95,12 +93,12 @@ aligned_alloc_annotated(size_t alignment, size_t count,
9593 static_cast <void >(propList);
9694
9795 constexpr size_t alignFromPropList =
98- detail::GetAlignFromPropList< propertyListA>:: value;
96+ detail::get_property_or<alignment_key, propertyListA>(alignment< 0 >). value ;
9997 const property_list &usmPropList = get_usm_property_list<propertyListA>();
10098
101- if constexpr (detail::HasUsmKind<propertyListA>::value ) {
99+ if constexpr (propertyListA:: template has_property<usm_kind_key>() ) {
102100 constexpr sycl::usm::alloc usmKind =
103- detail::GetUsmKindFromPropList<propertyListA>:: value;
101+ propertyListA:: template get_property<usm_kind_key>(). value ;
104102 if (usmKind != kind) {
105103 throw sycl::exception (
106104 sycl::make_error_code (sycl::errc::invalid),
@@ -113,7 +111,7 @@ aligned_alloc_annotated(size_t alignment, size_t count,
113111 throw sycl::exception (sycl::make_error_code (sycl::errc::invalid),
114112 " Unknown USM allocation kind was specified." );
115113
116- size_t combinedAlign = combine_align (alignment , alignFromPropList);
114+ size_t combinedAlign = combine_align (align , alignFromPropList);
117115 T *rawPtr = sycl::aligned_alloc<T>(combinedAlign, count, syclDevice,
118116 syclContext, kind, usmPropList);
119117 return annotated_ptr<T, propertyListB>(rawPtr);
@@ -212,7 +210,9 @@ std::enable_if_t<
212210malloc_annotated (size_t numBytes, const device &syclDevice,
213211 const context &syclContext, const propertyListA &propList) {
214212 constexpr sycl::usm::alloc usmKind =
215- detail::GetUsmKindFromPropList<propertyListA>::value;
213+ detail::get_property_or<usm_kind_key, propertyListA>(
214+ usm_kind<sycl::usm::alloc::unknown>)
215+ .value ;
216216 static_assert (usmKind != sycl::usm::alloc::unknown,
217217 " USM kind is not specified. Please specify it as an argument "
218218 " or in the input property list." );
@@ -228,7 +228,9 @@ std::enable_if_t<
228228malloc_annotated (size_t count, const device &syclDevice,
229229 const context &syclContext, const propertyListA &propList) {
230230 constexpr sycl::usm::alloc usmKind =
231- detail::GetUsmKindFromPropList<propertyListA>::value;
231+ detail::get_property_or<usm_kind_key, propertyListA>(
232+ usm_kind<sycl::usm::alloc::unknown>)
233+ .value ;
232234 static_assert (usmKind != sycl::usm::alloc::unknown,
233235 " USM kind is not specified. Please specify it as an argument "
234236 " or in the input property list." );
0 commit comments