Skip to content

Commit

Permalink
Create hybrid runtime prop with compile time info
Browse files Browse the repository at this point in the history
  • Loading branch information
Naghasan committed Nov 7, 2024
1 parent 986c9ff commit 5237f69
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 15 deletions.
2 changes: 1 addition & 1 deletion sycl/cmake/modules/UnifiedRuntimeTag.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
# Date: Thu Nov 7 11:43:19 2024 +0000
# Merge pull request #2233 from martygrant/martin/memory-cts-spec-gap-2
# Improvements to align CTS and Spec for Memory
set(UNIFIED_RUNTIME_TAG 09ae26af4e4e4301177db704b3b109ecd388c846)
set(UNIFIED_RUNTIME_TAG 09d658fe3dba98454e0eaec9cfac6cdfed7acbbf)
3 changes: 1 addition & 2 deletions sycl/include/sycl/ext/oneapi/properties/properties.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,7 @@ template <typename PropertiesT> class properties {
template <typename PropertyT>
static constexpr auto
get_property(typename std::enable_if_t<
detail::IsCompileTimeProperty<PropertyT>::value &&
!detail::IsRuntimeProperty<PropertyT>::value> * = 0) {
detail::IsCompileTimeProperty<PropertyT>::value> * = 0) {
static_assert(has_property<PropertyT>(),
"Property list does not contain the requested property.");
return detail::get_property<PropertyT, has_property<PropertyT>(),
Expand Down
3 changes: 1 addition & 2 deletions sycl/include/sycl/ext/oneapi/properties/property.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,6 @@ struct property_base : property_tag {

struct property_key_base_tag {};
struct compile_time_property_key_base_tag : property_key_base_tag {};
struct run_time_property_key_base_tag : property_key_base_tag {};

template <typename property_t, PropKind Kind_>
struct run_time_property_key : property_key_base_tag,
Expand Down Expand Up @@ -273,7 +272,7 @@ template <typename PropertyT>
struct IsRuntimeProperty
: std::bool_constant<
std::is_base_of_v<property_key_base_tag, PropertyT> &&
std::is_base_of_v<run_time_property_key_base_tag, PropertyT>> {};
!std::is_base_of_v<compile_time_property_key_base_tag, PropertyT>> {};

// Trait for identifying compile-time properties.
template <typename PropertyT>
Expand Down
14 changes: 4 additions & 10 deletions sycl/include/sycl/ext/oneapi/work_group_scratch_memory.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,24 +28,18 @@ inline void *get_work_group_scratch_memory() {
}

// Property
struct work_group_scratch_size_key
: ::sycl::ext::oneapi::experimental::detail::compile_time_property_key<
::sycl::ext::oneapi::experimental::detail::WorkGroupStaticMem>,
property_value<work_group_scratch_size_key> {
using value_t = property_value<work_group_scratch_size_key>;
};

struct work_group_scratch_size
: ::sycl::ext::oneapi::experimental::detail::run_time_property_key<
::sycl::ext::oneapi::experimental::detail::WorkGroupStaticMem>,
work_group_scratch_size_key {
using value_t = work_group_scratch_size_key::value_t;
work_group_scratch_size,
::sycl::ext::oneapi::experimental::detail::WorkGroupStaticMem> {
// Runtime property part
constexpr work_group_scratch_size(size_t bytes) : size(bytes) {}

size_t size;
};

using work_group_scratch_size_key = work_group_scratch_size;

template <> struct is_property_key<work_group_scratch_size> : std::true_type {};

template <>
Expand Down

0 comments on commit 5237f69

Please sign in to comment.