Skip to content

[SYCL] Remove redundant detail::empty_properties_t #13777

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -650,7 +650,7 @@ template <atomic_op Op, typename T, int N, typename Toffset, typename PropertyLi

// Similar to (usm-au0-1,2), but `byte_offset` is `simd_view`.
template <atomic_op Op, typename T, int N, typename OffsetSimdViewT,
typename PropertyListT = detail::empty_properties_t>
typename PropertyListT = empty_properties_t>
/*usm-au0-3*/ simd<T, N> atomic_update(T *p, OffsetSimdViewT byte_offset, simd_mask<N> mask, props = {});
/*usm-au0-4*/ simd<T, N> atomic_update(T *p, OffsetSimdViewT byte_offset, props = {});

Expand Down
820 changes: 401 additions & 419 deletions sycl/include/sycl/ext/intel/esimd/memory.hpp

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ namespace experimental {
// 3. "xxx_alloc_host_annotated" (defined in alloc_host.hpp)
// 4. "xxx_alloc_shared_annotated" (defined in alloc_shared.hpp)
////
template <typename propertyListA = detail::empty_properties_t,
template <typename propertyListA = empty_properties_t,
typename propertyListB =
typename detail::GetCompileTimeProperties<propertyListA>::type>
std::enable_if_t<
Expand Down Expand Up @@ -77,7 +77,7 @@ aligned_alloc_annotated(size_t alignment, size_t numBytes,
return annotated_ptr<void, propertyListB>(rawPtr);
}

template <typename T, typename propertyListA = detail::empty_properties_t,
template <typename T, typename propertyListA = empty_properties_t,
typename propertyListB =
typename detail::GetCompileTimeProperties<propertyListA>::type>
std::enable_if_t<
Expand Down Expand Up @@ -119,7 +119,7 @@ aligned_alloc_annotated(size_t alignment, size_t count,
return annotated_ptr<T, propertyListB>(rawPtr);
}

template <typename propertyListA = detail::empty_properties_t,
template <typename propertyListA = empty_properties_t,
typename propertyListB =
typename detail::GetCompileTimeProperties<propertyListA>::type>
std::enable_if_t<
Expand All @@ -132,7 +132,7 @@ aligned_alloc_annotated(size_t alignment, size_t numBytes,
syclQueue.get_context(), kind, propList);
}

template <typename T, typename propertyListA = detail::empty_properties_t,
template <typename T, typename propertyListA = empty_properties_t,
typename propertyListB =
typename detail::GetCompileTimeProperties<propertyListA>::type>
std::enable_if_t<
Expand All @@ -145,7 +145,7 @@ aligned_alloc_annotated(size_t alignment, size_t count, const queue &syclQueue,
syclQueue.get_context(), kind, propList);
}

template <typename propertyListA = detail::empty_properties_t,
template <typename propertyListA = empty_properties_t,
typename propertyListB =
typename detail::GetCompileTimeProperties<propertyListA>::type>
std::enable_if_t<
Expand All @@ -158,7 +158,7 @@ malloc_annotated(size_t numBytes, const device &syclDevice,
propList);
}

template <typename T, typename propertyListA = detail::empty_properties_t,
template <typename T, typename propertyListA = empty_properties_t,
typename propertyListB =
typename detail::GetCompileTimeProperties<propertyListA>::type>
std::enable_if_t<
Expand All @@ -171,7 +171,7 @@ malloc_annotated(size_t count, const device &syclDevice,
propList);
}

template <typename propertyListA = detail::empty_properties_t,
template <typename propertyListA = empty_properties_t,
typename propertyListB =
typename detail::GetCompileTimeProperties<propertyListA>::type>
std::enable_if_t<
Expand All @@ -183,7 +183,7 @@ malloc_annotated(size_t numBytes, const queue &syclQueue, sycl::usm::alloc kind,
syclQueue.get_context(), kind, propList);
}

template <typename T, typename propertyListA = detail::empty_properties_t,
template <typename T, typename propertyListA = empty_properties_t,
typename propertyListB =
typename detail::GetCompileTimeProperties<propertyListA>::type>
std::enable_if_t<
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ using GetAnnotatedDevicePtrProperties =
// `usm_kind<alloc::device>`, so reconstruct the real annotated_ptr that
// contains usm_kind using the raw pointer of "aligned_alloc_annotated" result
////
template <typename propertyListA = detail::empty_properties_t,
template <typename propertyListA = empty_properties_t,
typename propertyListB =
typename GetAnnotatedDevicePtrProperties<propertyListA>::type>
std::enable_if_t<
Expand All @@ -53,7 +53,7 @@ aligned_alloc_device_annotated(size_t alignment, size_t numBytes,
return annotated_ptr<void, propertyListB>(tmp.get());
}

template <typename T, typename propertyListA = detail::empty_properties_t,
template <typename T, typename propertyListA = empty_properties_t,
typename propertyListB =
typename GetAnnotatedDevicePtrProperties<propertyListA>::type>
std::enable_if_t<
Expand All @@ -69,7 +69,7 @@ aligned_alloc_device_annotated(size_t alignment, size_t count,
return annotated_ptr<T, propertyListB>(tmp.get());
}

template <typename propertyListA = detail::empty_properties_t,
template <typename propertyListA = empty_properties_t,
typename propertyListB =
typename GetAnnotatedDevicePtrProperties<propertyListA>::type>
std::enable_if_t<
Expand All @@ -83,7 +83,7 @@ aligned_alloc_device_annotated(size_t alignment, size_t numBytes,
syclQueue.get_context(), propList);
}

template <typename T, typename propertyListA = detail::empty_properties_t,
template <typename T, typename propertyListA = empty_properties_t,
typename propertyListB =
typename GetAnnotatedDevicePtrProperties<propertyListA>::type>
std::enable_if_t<
Expand All @@ -104,7 +104,7 @@ aligned_alloc_device_annotated(size_t alignment, size_t count,
// Note: "malloc_device_annotated" functions call
// "aligned_alloc_device_annotated" with alignment 0
////
template <typename propertyListA = detail::empty_properties_t,
template <typename propertyListA = empty_properties_t,
typename propertyListB =
typename GetAnnotatedDevicePtrProperties<propertyListA>::type>
std::enable_if_t<
Expand All @@ -117,7 +117,7 @@ malloc_device_annotated(size_t numBytes, const device &syclDevice,
propList);
}

template <typename T, typename propertyListA = detail::empty_properties_t,
template <typename T, typename propertyListA = empty_properties_t,
typename propertyListB =
typename GetAnnotatedDevicePtrProperties<propertyListA>::type>
std::enable_if_t<
Expand All @@ -130,7 +130,7 @@ malloc_device_annotated(size_t count, const device &syclDevice,
propList);
}

template <typename propertyListA = detail::empty_properties_t,
template <typename propertyListA = empty_properties_t,
typename propertyListB =
typename GetAnnotatedDevicePtrProperties<propertyListA>::type>
std::enable_if_t<
Expand All @@ -142,7 +142,7 @@ malloc_device_annotated(size_t numBytes, const queue &syclQueue,
syclQueue.get_context(), propList);
}

template <typename T, typename propertyListA = detail::empty_properties_t,
template <typename T, typename propertyListA = empty_properties_t,
typename propertyListB =
typename GetAnnotatedDevicePtrProperties<propertyListA>::type>
std::enable_if_t<
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ using GetAnnotatedHostPtrProperties =
// returned annotated_ptr of "aligned_alloc_annotated"
////

template <typename propertyListA = detail::empty_properties_t,
template <typename propertyListA = empty_properties_t,
typename propertyListB =
typename GetAnnotatedHostPtrProperties<propertyListA>::type>
std::enable_if_t<
Expand All @@ -52,7 +52,7 @@ aligned_alloc_host_annotated(size_t alignment, size_t numBytes,
return annotated_ptr<void, propertyListB>(tmp.get());
}

template <typename T, typename propertyListA = detail::empty_properties_t,
template <typename T, typename propertyListA = empty_properties_t,
typename propertyListB =
typename GetAnnotatedHostPtrProperties<propertyListA>::type>
std::enable_if_t<
Expand All @@ -66,7 +66,7 @@ aligned_alloc_host_annotated(size_t alignment, size_t count,
return annotated_ptr<T, propertyListB>(tmp.get());
}

template <typename propertyListA = detail::empty_properties_t,
template <typename propertyListA = empty_properties_t,
typename propertyListB =
typename GetAnnotatedHostPtrProperties<propertyListA>::type>
std::enable_if_t<
Expand All @@ -79,7 +79,7 @@ aligned_alloc_host_annotated(size_t alignment, size_t numBytes,
syclQueue.get_context(), propList);
}

template <typename T, typename propertyListA = detail::empty_properties_t,
template <typename T, typename propertyListA = empty_properties_t,
typename propertyListB =
typename GetAnnotatedHostPtrProperties<propertyListA>::type>
std::enable_if_t<
Expand All @@ -99,7 +99,7 @@ aligned_alloc_host_annotated(size_t alignment, size_t count,
// with alignment 0
////

template <typename propertyListA = detail::empty_properties_t,
template <typename propertyListA = empty_properties_t,
typename propertyListB =
typename GetAnnotatedHostPtrProperties<propertyListA>::type>
std::enable_if_t<
Expand All @@ -110,7 +110,7 @@ malloc_host_annotated(size_t numBytes, const context &syclContext,
return aligned_alloc_host_annotated(0, numBytes, syclContext, propList);
}

template <typename T, typename propertyListA = detail::empty_properties_t,
template <typename T, typename propertyListA = empty_properties_t,
typename propertyListB =
typename GetAnnotatedHostPtrProperties<propertyListA>::type>
std::enable_if_t<
Expand All @@ -121,7 +121,7 @@ malloc_host_annotated(size_t count, const context &syclContext,
return aligned_alloc_host_annotated<T>(0, count, syclContext, propList);
}

template <typename propertyListA = detail::empty_properties_t,
template <typename propertyListA = empty_properties_t,
typename propertyListB =
typename GetAnnotatedHostPtrProperties<propertyListA>::type>
std::enable_if_t<
Expand All @@ -132,7 +132,7 @@ malloc_host_annotated(size_t numBytes, const queue &syclQueue,
return malloc_host_annotated(numBytes, syclQueue.get_context(), propList);
}

template <typename T, typename propertyListA = detail::empty_properties_t,
template <typename T, typename propertyListA = empty_properties_t,
typename propertyListB =
typename GetAnnotatedHostPtrProperties<propertyListA>::type>
std::enable_if_t<
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ using GetAnnotatedSharedPtrProperties =
// returned annotated_ptr of "aligned_alloc_annotated"
////

template <typename propertyListA = detail::empty_properties_t,
template <typename propertyListA = empty_properties_t,
typename propertyListB =
typename GetAnnotatedSharedPtrProperties<propertyListA>::type>
std::enable_if_t<
Expand All @@ -53,7 +53,7 @@ aligned_alloc_shared_annotated(size_t alignment, size_t numBytes,
return annotated_ptr<void, propertyListB>(tmp.get());
}

template <typename T, typename propertyListA = detail::empty_properties_t,
template <typename T, typename propertyListA = empty_properties_t,
typename propertyListB =
typename GetAnnotatedSharedPtrProperties<propertyListA>::type>
std::enable_if_t<
Expand All @@ -69,7 +69,7 @@ aligned_alloc_shared_annotated(size_t alignment, size_t count,
return annotated_ptr<T, propertyListB>(tmp.get());
}

template <typename propertyListA = detail::empty_properties_t,
template <typename propertyListA = empty_properties_t,
typename propertyListB =
typename GetAnnotatedSharedPtrProperties<propertyListA>::type>
std::enable_if_t<
Expand All @@ -83,7 +83,7 @@ aligned_alloc_shared_annotated(size_t alignment, size_t numBytes,
syclQueue.get_context(), propList);
}

template <typename T, typename propertyListA = detail::empty_properties_t,
template <typename T, typename propertyListA = empty_properties_t,
typename propertyListB =
typename GetAnnotatedSharedPtrProperties<propertyListA>::type>
std::enable_if_t<
Expand All @@ -104,7 +104,7 @@ aligned_alloc_shared_annotated(size_t alignment, size_t count,
// "aligned_alloc_shared_annotated" with alignment 0
////

template <typename propertyListA = detail::empty_properties_t,
template <typename propertyListA = empty_properties_t,
typename propertyListB =
typename GetAnnotatedSharedPtrProperties<propertyListA>::type>
std::enable_if_t<
Expand All @@ -117,7 +117,7 @@ malloc_shared_annotated(size_t numBytes, const device &syclDevice,
propList);
}

template <typename T, typename propertyListA = detail::empty_properties_t,
template <typename T, typename propertyListA = empty_properties_t,
typename propertyListB =
typename GetAnnotatedSharedPtrProperties<propertyListA>::type>
std::enable_if_t<
Expand All @@ -130,7 +130,7 @@ malloc_shared_annotated(size_t count, const device &syclDevice,
propList);
}

template <typename propertyListA = detail::empty_properties_t,
template <typename propertyListA = empty_properties_t,
typename propertyListB =
typename GetAnnotatedSharedPtrProperties<propertyListA>::type>
std::enable_if_t<
Expand All @@ -142,7 +142,7 @@ malloc_shared_annotated(size_t numBytes, const queue &syclQueue,
syclQueue.get_context(), propList);
}

template <typename T, typename propertyListA = detail::empty_properties_t,
template <typename T, typename propertyListA = empty_properties_t,
typename propertyListB =
typename GetAnnotatedSharedPtrProperties<propertyListA>::type>
std::enable_if_t<
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,7 @@ template <typename Prop> struct IsRuntimePropertyValid : std::false_type {};
template <typename T, typename propertyList>
struct ValidAllocPropertyList : std::false_type {};
template <typename T>
struct ValidAllocPropertyList<T, detail::empty_properties_t> : std::true_type {
};
struct ValidAllocPropertyList<T, empty_properties_t> : std::true_type {};
template <typename T, typename Prop, typename... Props>
struct ValidAllocPropertyList<T, detail::properties_t<Prop, Props...>>
: std::integral_constant<
Expand All @@ -117,24 +116,22 @@ struct ValidAllocPropertyList<T, detail::properties_t<Prop, Props...>>
// annotated_ptr
template <typename PropertyListT> struct GetCompileTimeProperties {};

template <> struct GetCompileTimeProperties<detail::empty_properties_t> {
using type = detail::empty_properties_t;
template <> struct GetCompileTimeProperties<empty_properties_t> {
using type = empty_properties_t;
};

template <typename Prop>
struct GetCompileTimeProperties<detail::properties_t<Prop>> {
using type =
std::conditional_t<detail::IsCompileTimePropertyValue<Prop>::value,
detail::properties_t<Prop>,
detail::empty_properties_t>;
detail::properties_t<Prop>, empty_properties_t>;
};

template <typename Prop, typename... Props>
struct GetCompileTimeProperties<detail::properties_t<Prop, Props...>> {
using filtered_this_property_t =
std::conditional_t<detail::IsCompileTimePropertyValue<Prop>::value,
detail::properties_t<Prop>,
detail::empty_properties_t>;
detail::properties_t<Prop>, empty_properties_t>;
using filtered_other_properties_t =
typename GetCompileTimeProperties<detail::properties_t<Props...>>::type;
using type = detail::merged_properties_t<filtered_this_property_t,
Expand Down
8 changes: 3 additions & 5 deletions sycl/include/sycl/ext/oneapi/properties/properties.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ properties(PropertyValueTs... props)
-> properties<typename detail::Sorted<PropertyValueTs...>::type>;
#endif

using empty_properties_t = decltype(properties{});
using empty_properties_t = properties<std::tuple<>>;

// Property list traits
template <typename propertiesT> struct is_property_list : std::false_type {};
Expand All @@ -203,8 +203,6 @@ inline constexpr bool is_property_list_v = is_property_list<propertiesT>::value;
#endif

namespace detail {
// Helper for default properties when deduction guides are not enabled.
using empty_properties_t = properties<std::tuple<>>;

// Helper for reconstructing a properties type. This assumes that
// PropertyValueTs is sorted and contains only valid properties.
Expand Down Expand Up @@ -247,8 +245,8 @@ template <typename SyclT, typename PropertiesT>
struct all_props_are_keys_of : std::true_type {};

template <typename SyclT>
struct all_props_are_keys_of<
SyclT, ext::oneapi::experimental::detail::empty_properties_t>
struct all_props_are_keys_of<SyclT,
ext::oneapi::experimental::empty_properties_t>
: std::true_type {};

template <typename SyclT, typename PropT>
Expand Down
4 changes: 2 additions & 2 deletions sycl/include/sycl/kernel_bundle.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -879,7 +879,7 @@ build_from_source(kernel_bundle<bundle_state::ext_oneapi_source> &SourceKB,

} // namespace detail

template <typename PropertyListT = detail::empty_properties_t,
template <typename PropertyListT = empty_properties_t,
typename = std::enable_if_t<
is_property_list_v<PropertyListT> &&
detail::all_props_are_keys_of<
Expand All @@ -900,7 +900,7 @@ build(kernel_bundle<bundle_state::ext_oneapi_source> &SourceKB,
return detail::build_from_source(SourceKB, Devices, BuildOptionsVec, LogPtr);
}

template <typename PropertyListT = detail::empty_properties_t,
template <typename PropertyListT = empty_properties_t,
typename = std::enable_if_t<
is_property_list_v<PropertyListT> &&
detail::all_props_are_keys_of<
Expand Down