diff --git a/sycl/include/sycl/ext/oneapi/properties/property.hpp b/sycl/include/sycl/ext/oneapi/properties/property.hpp index 33228130ec36d..d1797b08ce324 100644 --- a/sycl/include/sycl/ext/oneapi/properties/property.hpp +++ b/sycl/include/sycl/ext/oneapi/properties/property.hpp @@ -264,6 +264,13 @@ struct IsCompileTimeProperty std::is_base_of_v && std::is_base_of_v> {}; +// Checks if a type is either a runtime property or if it is a compile-time +// property +template struct IsProperty { + static constexpr bool value = + IsRuntimeProperty::value || IsCompileTimeProperty::value; +}; + // Trait for property compile-time meta names and values. template struct PropertyMetaInfo { // Some properties don't have meaningful compile-time values. diff --git a/sycl/include/sycl/ext/oneapi/properties/property_utils.hpp b/sycl/include/sycl/ext/oneapi/properties/property_utils.hpp index 804dc6f4279cd..3280d77aa6258 100644 --- a/sycl/include/sycl/ext/oneapi/properties/property_utils.hpp +++ b/sycl/include/sycl/ext/oneapi/properties/property_utils.hpp @@ -12,7 +12,8 @@ #include // for mp_list #include // for mp_rename #include // for mp_bool -#include // for PropertyID, IsRun... +#include +#include #include // for tuple_element #include // for size_t @@ -48,34 +49,10 @@ struct PrependTuple> { using type = std::tuple; }; -// Checks if a type T has a static value member variable. -template struct HasValue : std::false_type {}; -template -struct HasValue : std::true_type {}; - //****************************************************************************** // Property identification //****************************************************************************** -// Checks if a type is a compile-time property values. -// Note: This is specialized for property_value elsewhere. -template -struct IsCompileTimePropertyValue : std::false_type {}; - -// Checks if a type is either a runtime property or if it is a compile-time -// property -template struct IsProperty { - static constexpr bool value = - IsRuntimeProperty::value || IsCompileTimeProperty::value; -}; - -// Checks if a type is a valid property value, i.e either runtime property or -// property_value with a valid compile-time property -template struct IsPropertyValue { - static constexpr bool value = - IsRuntimeProperty::value || IsCompileTimePropertyValue::value; -}; - // Checks that all types in a tuple are valid properties. template struct AllPropertyValues {}; template diff --git a/sycl/include/sycl/ext/oneapi/properties/property_value.hpp b/sycl/include/sycl/ext/oneapi/properties/property_value.hpp index e208f59d85830..dc7d13145677d 100644 --- a/sycl/include/sycl/ext/oneapi/properties/property_value.hpp +++ b/sycl/include/sycl/ext/oneapi/properties/property_value.hpp @@ -8,8 +8,7 @@ #pragma once -#include // for IsCompileTi... -#include // for HasValue +#include #include // for enable_if_t @@ -18,6 +17,11 @@ inline namespace _V1 { namespace ext::oneapi::experimental { namespace detail { +// Checks if a type T has a static value member variable. +template struct HasValue : std::false_type {}; +template +struct HasValue : std::true_type {}; + // Base class for property values with a single non-type value template struct SingleNontypePropertyValueBase {}; @@ -80,11 +84,19 @@ template struct PropertyID> : PropertyID {}; -// Specialization of IsCompileTimePropertyValue for property values. +// Checks if a type is a compile-time property values. +template +struct IsCompileTimePropertyValue : std::false_type {}; template struct IsCompileTimePropertyValue> : IsCompileTimeProperty {}; +// Checks if a type is a valid property value, i.e either runtime property or +// property_value with a valid compile-time property +template struct IsPropertyValue { + static constexpr bool value = + IsRuntimeProperty::value || IsCompileTimePropertyValue::value; +}; } // namespace detail } // namespace ext::oneapi::experimental } // namespace _V1 diff --git a/sycl/test/include_deps/sycl_detail_core.hpp.cpp b/sycl/test/include_deps/sycl_detail_core.hpp.cpp index d7141579c0f48..e9555d3ad95d1 100644 --- a/sycl/test/include_deps/sycl_detail_core.hpp.cpp +++ b/sycl/test/include_deps/sycl_detail_core.hpp.cpp @@ -136,8 +136,8 @@ // CHECK-NEXT: ext/oneapi/device_global/properties.hpp // CHECK-NEXT: ext/oneapi/properties/property.hpp // CHECK-NEXT: ext/oneapi/properties/property_value.hpp -// CHECK-NEXT: ext/oneapi/properties/property_utils.hpp // CHECK-NEXT: ext/oneapi/properties/properties.hpp +// CHECK-NEXT: ext/oneapi/properties/property_utils.hpp // CHECK-NEXT: ext/oneapi/experimental/graph.hpp // CHECK-NEXT: handler.hpp // CHECK-NEXT: detail/cl.h