diff --git a/sycl/include/sycl/accessor.hpp b/sycl/include/sycl/accessor.hpp index 485753e2af549..5ff42e386699a 100644 --- a/sycl/include/sycl/accessor.hpp +++ b/sycl/include/sycl/accessor.hpp @@ -22,7 +22,6 @@ #include // for OwnerLessBase #include // for PropWithDataKind #include // for PropertyListBase -#include // for is_contained #include // for const_if_const_AS #include // for make_error_code #include // for accessor_prope... diff --git a/sycl/include/sycl/builtins_utils_scalar.hpp b/sycl/include/sycl/builtins_utils_scalar.hpp index ff567bfea2b15..7e1c992ad073f 100644 --- a/sycl/include/sycl/builtins_utils_scalar.hpp +++ b/sycl/include/sycl/builtins_utils_scalar.hpp @@ -12,7 +12,6 @@ #include #include #include -#include #include #include #include diff --git a/sycl/include/sycl/detail/generic_type_traits.hpp b/sycl/include/sycl/detail/generic_type_traits.hpp index 6d00a39304d0c..d8ac96e240e9b 100644 --- a/sycl/include/sycl/detail/generic_type_traits.hpp +++ b/sycl/include/sycl/detail/generic_type_traits.hpp @@ -11,7 +11,6 @@ #include // for decorated, address_space #include // for half, cl_char, cl_double #include // for marray -#include // for is_contained, find_sam... #include // for is_gen_based_on_type_s... #include // for BIsRepresentationT #include // for multi_ptr, address_spa... diff --git a/sycl/include/sycl/detail/image_accessor_util.hpp b/sycl/include/sycl/detail/image_accessor_util.hpp index 49dacd704a748..d87038a8c9ce3 100644 --- a/sycl/include/sycl/detail/image_accessor_util.hpp +++ b/sycl/include/sycl/detail/image_accessor_util.hpp @@ -18,7 +18,6 @@ #include // for array #include // for __SYCL_EXPORT #include // for max_v, min_v, TryToGe... -#include // for is_contained, type_list #include #include // for id #include // for image_channel_type @@ -35,26 +34,25 @@ inline namespace _V1 { namespace detail { template -using IsValidCoordType = typename is_contained< - T, boost::mp11::mp_unique>>::type; +inline constexpr bool is_valid_coord_type_v = + check_type_in_v; // The formula for unnormalization coordinates: // NormalizedCoords = [UnnormalizedCoords[i] * Range[i] for i in range(0, 3)] template -std::enable_if_t::value, T> +std::enable_if_t, T> UnnormalizeCoordinates(const T &Coords, const range<3> &Range) { return Coords * Range[0]; } template -std::enable_if_t::value, vec> +std::enable_if_t, vec> UnnormalizeCoordinates(const vec &Coords, const range<3> &Range) { return {Coords.x() * Range[0], Coords.y() * Range[1]}; } template -std::enable_if_t::value, vec> +std::enable_if_t, vec> UnnormalizeCoordinates(const vec &Coords, const range<3> &Range) { return {Coords.x() * Range[0], Coords.y() * Range[1], Coords.z() * Range[2], 0}; @@ -65,19 +63,19 @@ UnnormalizeCoordinates(const vec &Coords, const range<3> &Range) { // calculation won't pass 0. // Non-valid coordinates are written as 0. template -std::enable_if_t::value, float4> convertToFloat4(T Coords) { +std::enable_if_t, float4> convertToFloat4(T Coords) { return {static_cast(Coords), 0.5f, 0.5f, 0.f}; } template -std::enable_if_t::value, float4> +std::enable_if_t, float4> convertToFloat4(vec Coords) { return {static_cast(Coords.x()), static_cast(Coords.y()), 0.5f, 0.f}; } template -std::enable_if_t::value, float4> +std::enable_if_t, float4> convertToFloat4(vec Coords) { return {static_cast(Coords.x()), static_cast(Coords.y()), static_cast(Coords.z()), 0.f}; diff --git a/sycl/include/sycl/detail/spirv.hpp b/sycl/include/sycl/detail/spirv.hpp index 32d87c7562b77..ad59d129622b9 100644 --- a/sycl/include/sycl/detail/spirv.hpp +++ b/sycl/include/sycl/detail/spirv.hpp @@ -796,13 +796,11 @@ AtomicMax(multi_ptr MPtr, memory_scope Scope, // variants for all scalar types #ifndef __NVPTX__ -using ProhibitedTypesForShuffleEmulation = - type_list; - template struct TypeIsProhibitedForShuffleEmulation - : std::bool_constant, ProhibitedTypesForShuffleEmulation>::value> {}; + : std::bool_constant< + check_type_in_v, double, long, long long, + unsigned long, unsigned long long, half>> {}; template struct VecTypeIsProhibitedForShuffleEmulation diff --git a/sycl/include/sycl/detail/type_list.hpp b/sycl/include/sycl/detail/type_list.hpp deleted file mode 100644 index 86d83b296ff93..0000000000000 --- a/sycl/include/sycl/detail/type_list.hpp +++ /dev/null @@ -1,91 +0,0 @@ -//==----------- type_list.hpp - SYCL list of types utils -------------------==// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -#pragma once - -#include // for address_space - -#include // for bool_constant, conditional_t, fals... - -#include -#include - -namespace sycl { -inline namespace _V1 { -namespace detail { - -template using type_list = boost::mp11::mp_list; - -using empty_type_list = type_list<>; - -template -using is_empty_type_list = std::is_same; - -// is_contained -template -using is_contained = - boost::mp11::mp_set_contains>; -template -inline constexpr bool is_contained_v = is_contained::value; - -// type list append -template using tl_append = boost::mp11::mp_append; - -// value_list -template struct value_list; - -template struct value_list { - static constexpr T head = Head; - using tail = value_list; -}; - -template struct value_list {}; - -template using tail_t = typename T::tail; - -// is_contained_value -template -struct is_contained_value - : std::conditional_t>> {}; - -template -struct is_contained_value> : std::false_type {}; - -// address_space_list -template -using address_space_list = value_list; - -template -using is_one_of_spaces = - is_contained_value; - -// size type predicates -template -struct is_type_size_equal : std::bool_constant<(sizeof(T1) == sizeof(T2))> {}; - -// find required type -template class Comp, - typename T> -struct find_type { - template using C = Comp; // bind back - using l = boost::mp11::mp_copy_if; - using type = boost::mp11::mp_eval_if, void, - boost::mp11::mp_front, l>; -}; - -template class Comp, - typename T> -using find_type_t = typename find_type::type; - -template -using find_same_size_type_t = find_type_t; - -} // namespace detail -} // namespace _V1 -} // namespace sycl diff --git a/sycl/include/sycl/detail/type_traits.hpp b/sycl/include/sycl/detail/type_traits.hpp index df5f9ea53a045..63bdc88ff4ba1 100644 --- a/sycl/include/sycl/detail/type_traits.hpp +++ b/sycl/include/sycl/detail/type_traits.hpp @@ -10,8 +10,7 @@ #include -#include // for decorated, address_space -#include // for is_contained, find_twi... +#include // for decorated, address_space #include // for array #include // for size_t diff --git a/sycl/include/sycl/detail/vector_arith.hpp b/sycl/include/sycl/detail/vector_arith.hpp index 4267febad8e30..d592c4a7e0b68 100644 --- a/sycl/include/sycl/detail/vector_arith.hpp +++ b/sycl/include/sycl/detail/vector_arith.hpp @@ -10,7 +10,6 @@ #include // for half, cl_char, cl_int #include // for is_sigeninteger, is_s... -#include // for is_contained #include // for is_floating_point #include // bfloat16 diff --git a/sycl/include/sycl/group_algorithm.hpp b/sycl/include/sycl/group_algorithm.hpp index ed373a95eef41..e3192a481bdb1 100644 --- a/sycl/include/sycl/group_algorithm.hpp +++ b/sycl/include/sycl/group_algorithm.hpp @@ -11,7 +11,6 @@ #include // for array #include // for loop #include // for id, range -#include // for is_contained, type_list #include // for remove_pointer, is_pointer #include // for make_error_code, errc, exception #include // for plus, multiplies, maximum @@ -82,19 +81,18 @@ template inline auto get_local_linear_id(Group g) { } // ---- is_native_op -template -using native_op_list = - type_list, sycl::bit_or, sycl::bit_xor, - sycl::bit_and, sycl::maximum, sycl::minimum, - sycl::multiplies, sycl::logical_or, sycl::logical_and>; +template +inline constexpr bool is_native_binop_on_v = + check_type_in_v, sycl::bit_or, + sycl::bit_xor, sycl::bit_and, sycl::maximum, + sycl::minimum, sycl::multiplies, sycl::logical_or, + sycl::logical_and>; template struct is_native_op { static constexpr bool value = - is_contained>>::value || - is_contained>>::value || - is_contained>::value; + is_native_binop_on_v> || + is_native_binop_on_v> || + is_native_binop_on_v; }; // ---- is_plus diff --git a/sycl/include/sycl/image.hpp b/sycl/include/sycl/image.hpp index 386fe93d3e41d..45cfb884dae3f 100644 --- a/sycl/include/sycl/image.hpp +++ b/sycl/include/sycl/image.hpp @@ -22,7 +22,6 @@ #include // for OwnerLessBase #include // for iterator_value... #include // for SYCLMemObjAllo... -#include // for is_contained #include // for event #include // for make_error_code #include // for accessor_prope... @@ -112,15 +111,12 @@ namespace detail { class image_impl; -// validImageDataT: cl_int4, cl_uint4, cl_float4, cl_half4 -template -using is_validImageDataT = typename detail::is_contained< - T, type_list, vec, - vec, vec>>::type; - +// Valid image DataT: cl_int4, cl_uint4, cl_float4, cl_half4 template -using EnableIfImgAccDataT = - typename std::enable_if_t::value, DataT>; +using EnableIfImgAccDataT = typename std::enable_if_t< + check_type_in_v, vec, + vec, vec>, + DataT>; inline image_channel_type FormatChannelType(image_format Format) { switch (Format) { diff --git a/sycl/include/sycl/types.hpp b/sycl/include/sycl/types.hpp index 599ba89819241..ed5432a912af1 100644 --- a/sycl/include/sycl/types.hpp +++ b/sycl/include/sycl/types.hpp @@ -14,7 +14,6 @@ #include // for __SYCL2020_DEPRECATED #include // for is_sigeninteger, is_s... #include -#include // for is_contained #include // for is_floating_point #include // for make_error_code, errc #include // for StorageT, half, Vec16... diff --git a/sycl/test/include_deps/sycl_accessor.hpp.cpp b/sycl/test/include_deps/sycl_accessor.hpp.cpp index 46979fdd721b2..6f961731eebfe 100644 --- a/sycl/test/include_deps/sycl_accessor.hpp.cpp +++ b/sycl/test/include_deps/sycl_accessor.hpp.cpp @@ -25,42 +25,14 @@ // CHECK-NEXT: info/aspects_deprecated.def // CHECK-NEXT: detail/type_traits.hpp // CHECK-NEXT: detail/type_traits/vec_marray_traits.hpp -// CHECK-NEXT: detail/type_list.hpp -// CHECK-NEXT: detail/boost/mp11/algorithm.hpp -// CHECK-NEXT: detail/boost/mp11/list.hpp -// CHECK-NEXT: detail/boost/mp11/integral.hpp -// CHECK-NEXT: detail/boost/mp11/version.hpp -// CHECK-NEXT: detail/boost/mp11/detail/mp_value.hpp -// CHECK-NEXT: detail/boost/mp11/detail/config.hpp -// CHECK-NEXT: detail/boost/mp11/detail/mp_list.hpp -// CHECK-NEXT: detail/boost/mp11/detail/mp_list_v.hpp -// CHECK-NEXT: detail/boost/mp11/detail/mp_is_list.hpp -// CHECK-NEXT: detail/boost/mp11/detail/mp_is_value_list.hpp -// CHECK-NEXT: detail/boost/mp11/detail/mp_front.hpp -// CHECK-NEXT: detail/boost/mp11/detail/mp_rename.hpp -// CHECK-NEXT: detail/boost/mp11/detail/mp_defer.hpp -// CHECK-NEXT: detail/boost/mp11/detail/mp_append.hpp -// CHECK-NEXT: detail/boost/mp11/detail/mp_count.hpp -// CHECK-NEXT: detail/boost/mp11/detail/mp_plus.hpp -// CHECK-NEXT: detail/boost/mp11/utility.hpp -// CHECK-NEXT: detail/boost/mp11/detail/mp_fold.hpp -// CHECK-NEXT: detail/boost/mp11/set.hpp -// CHECK-NEXT: detail/boost/mp11/function.hpp -// CHECK-NEXT: detail/boost/mp11/detail/mp_min_element.hpp -// CHECK-NEXT: detail/boost/mp11/detail/mp_void.hpp -// CHECK-NEXT: detail/boost/mp11/detail/mp_copy_if.hpp -// CHECK-NEXT: detail/boost/mp11/detail/mp_remove_if.hpp -// CHECK-NEXT: detail/boost/mp11/detail/mp_map_find.hpp -// CHECK-NEXT: detail/boost/mp11/detail/mp_with_index.hpp -// CHECK-NEXT: stl_wrappers/cassert -// CHECK-NEXT: stl_wrappers/assert.h -// CHECK-NEXT: detail/boost/mp11/integer_sequence.hpp // CHECK-NEXT: buffer.hpp // CHECK-NEXT: backend_types.hpp // CHECK-NEXT: detail/array.hpp // CHECK-NEXT: exception.hpp // CHECK-NEXT: detail/string.hpp // CHECK-NEXT: detail/common.hpp +// CHECK-NEXT: stl_wrappers/cassert +// CHECK-NEXT: stl_wrappers/assert.h // CHECK-NEXT: detail/is_device_copyable.hpp // CHECK-NEXT: detail/owner_less_base.hpp // CHECK-NEXT: detail/impl_utils.hpp diff --git a/sycl/test/include_deps/sycl_detail_core.hpp.cpp b/sycl/test/include_deps/sycl_detail_core.hpp.cpp index c7f905b222dd9..4abe5f39073c7 100644 --- a/sycl/test/include_deps/sycl_detail_core.hpp.cpp +++ b/sycl/test/include_deps/sycl_detail_core.hpp.cpp @@ -26,42 +26,14 @@ // CHECK-NEXT: info/aspects_deprecated.def // CHECK-NEXT: detail/type_traits.hpp // CHECK-NEXT: detail/type_traits/vec_marray_traits.hpp -// CHECK-NEXT: detail/type_list.hpp -// CHECK-NEXT: detail/boost/mp11/algorithm.hpp -// CHECK-NEXT: detail/boost/mp11/list.hpp -// CHECK-NEXT: detail/boost/mp11/integral.hpp -// CHECK-NEXT: detail/boost/mp11/version.hpp -// CHECK-NEXT: detail/boost/mp11/detail/mp_value.hpp -// CHECK-NEXT: detail/boost/mp11/detail/config.hpp -// CHECK-NEXT: detail/boost/mp11/detail/mp_list.hpp -// CHECK-NEXT: detail/boost/mp11/detail/mp_list_v.hpp -// CHECK-NEXT: detail/boost/mp11/detail/mp_is_list.hpp -// CHECK-NEXT: detail/boost/mp11/detail/mp_is_value_list.hpp -// CHECK-NEXT: detail/boost/mp11/detail/mp_front.hpp -// CHECK-NEXT: detail/boost/mp11/detail/mp_rename.hpp -// CHECK-NEXT: detail/boost/mp11/detail/mp_defer.hpp -// CHECK-NEXT: detail/boost/mp11/detail/mp_append.hpp -// CHECK-NEXT: detail/boost/mp11/detail/mp_count.hpp -// CHECK-NEXT: detail/boost/mp11/detail/mp_plus.hpp -// CHECK-NEXT: detail/boost/mp11/utility.hpp -// CHECK-NEXT: detail/boost/mp11/detail/mp_fold.hpp -// CHECK-NEXT: detail/boost/mp11/set.hpp -// CHECK-NEXT: detail/boost/mp11/function.hpp -// CHECK-NEXT: detail/boost/mp11/detail/mp_min_element.hpp -// CHECK-NEXT: detail/boost/mp11/detail/mp_void.hpp -// CHECK-NEXT: detail/boost/mp11/detail/mp_copy_if.hpp -// CHECK-NEXT: detail/boost/mp11/detail/mp_remove_if.hpp -// CHECK-NEXT: detail/boost/mp11/detail/mp_map_find.hpp -// CHECK-NEXT: detail/boost/mp11/detail/mp_with_index.hpp -// CHECK-NEXT: stl_wrappers/cassert -// CHECK-NEXT: stl_wrappers/assert.h -// CHECK-NEXT: detail/boost/mp11/integer_sequence.hpp // CHECK-NEXT: buffer.hpp // CHECK-NEXT: backend_types.hpp // CHECK-NEXT: detail/array.hpp // CHECK-NEXT: exception.hpp // CHECK-NEXT: detail/string.hpp // CHECK-NEXT: detail/common.hpp +// CHECK-NEXT: stl_wrappers/cassert +// CHECK-NEXT: stl_wrappers/assert.h // CHECK-NEXT: detail/is_device_copyable.hpp // CHECK-NEXT: detail/owner_less_base.hpp // CHECK-NEXT: detail/impl_utils.hpp @@ -138,6 +110,33 @@ // CHECK-NEXT: ext/oneapi/properties/property_value.hpp // CHECK-NEXT: ext/oneapi/properties/properties.hpp // CHECK-NEXT: ext/oneapi/properties/property_utils.hpp +// CHECK-NEXT: detail/boost/mp11/algorithm.hpp +// CHECK-NEXT: detail/boost/mp11/list.hpp +// CHECK-NEXT: detail/boost/mp11/integral.hpp +// CHECK-NEXT: detail/boost/mp11/version.hpp +// CHECK-NEXT: detail/boost/mp11/detail/mp_value.hpp +// CHECK-NEXT: detail/boost/mp11/detail/config.hpp +// CHECK-NEXT: detail/boost/mp11/detail/mp_list.hpp +// CHECK-NEXT: detail/boost/mp11/detail/mp_list_v.hpp +// CHECK-NEXT: detail/boost/mp11/detail/mp_is_list.hpp +// CHECK-NEXT: detail/boost/mp11/detail/mp_is_value_list.hpp +// CHECK-NEXT: detail/boost/mp11/detail/mp_front.hpp +// CHECK-NEXT: detail/boost/mp11/detail/mp_rename.hpp +// CHECK-NEXT: detail/boost/mp11/detail/mp_defer.hpp +// CHECK-NEXT: detail/boost/mp11/detail/mp_append.hpp +// CHECK-NEXT: detail/boost/mp11/detail/mp_count.hpp +// CHECK-NEXT: detail/boost/mp11/detail/mp_plus.hpp +// CHECK-NEXT: detail/boost/mp11/utility.hpp +// CHECK-NEXT: detail/boost/mp11/detail/mp_fold.hpp +// CHECK-NEXT: detail/boost/mp11/set.hpp +// CHECK-NEXT: detail/boost/mp11/function.hpp +// CHECK-NEXT: detail/boost/mp11/detail/mp_min_element.hpp +// CHECK-NEXT: detail/boost/mp11/detail/mp_void.hpp +// CHECK-NEXT: detail/boost/mp11/detail/mp_copy_if.hpp +// CHECK-NEXT: detail/boost/mp11/detail/mp_remove_if.hpp +// CHECK-NEXT: detail/boost/mp11/detail/mp_map_find.hpp +// CHECK-NEXT: detail/boost/mp11/detail/mp_with_index.hpp +// CHECK-NEXT: detail/boost/mp11/integer_sequence.hpp // CHECK-NEXT: ext/oneapi/experimental/graph.hpp // CHECK-NEXT: handler.hpp // CHECK-NEXT: detail/cl.h diff --git a/sycl/test/type_traits/type_list.cpp b/sycl/test/type_traits/type_list.cpp deleted file mode 100644 index 90702d4d90858..0000000000000 --- a/sycl/test/type_traits/type_list.cpp +++ /dev/null @@ -1,86 +0,0 @@ -// RUN: %clangxx -fsycl -fsyntax-only %s -//==---------------- type_list.cpp - SYCL type_list test -------------------==// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -#include - -#include - -using namespace std; - -namespace s = sycl; -namespace d = sycl::detail; - -template