Skip to content

Commit

Permalink
Drop unused type traits
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexeySachkov committed Sep 24, 2024
1 parent eb2a423 commit 50ba40c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 50 deletions.
30 changes: 2 additions & 28 deletions sycl/include/sycl/detail/type_traits.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -441,27 +441,6 @@ struct remove_pointer : remove_pointer_impl<std::remove_cv_t<T>> {};

template <typename T> using remove_pointer_t = typename remove_pointer<T>::type;

// is_address_space_compliant
template <typename T, typename SpaceList>
struct is_address_space_compliant_impl : std::false_type {};

template <typename T, typename SpaceList>
struct is_address_space_compliant_impl<T *, SpaceList> : std::true_type {};

template <typename T, typename SpaceList, access::address_space Space,
access::decorated DecorateAddress>
struct is_address_space_compliant_impl<multi_ptr<T, Space, DecorateAddress>,
SpaceList>
: std::bool_constant<is_one_of_spaces<Space, SpaceList>::value> {};

template <typename T, typename SpaceList>
struct is_address_space_compliant
: is_address_space_compliant_impl<std::remove_cv_t<T>, SpaceList> {};

template <typename T, typename SpaceList>
inline constexpr bool is_address_space_compliant_v =
is_address_space_compliant<T, SpaceList>::value;

// make_type_t
template <typename T, typename TL> struct make_type_impl {
using type = find_same_size_type_t<TL, T>;
Expand Down Expand Up @@ -514,6 +493,8 @@ struct make_larger_impl<marray<T, N>, marray<T, N>> {
using type = std::conditional_t<found, new_type, void>;
};

// TODO: this type trait is not used anyweher in SYCL headers and it should
// be moved to the library code
template <typename T> struct make_larger {
using type = typename make_larger_impl<T, T>::type;
};
Expand All @@ -530,13 +511,6 @@ template <access::address_space AS, class DataT>
using const_if_const_AS = DataT;
#endif

template <typename T> struct function_traits {};

template <typename Ret, typename... Args> struct function_traits<Ret(Args...)> {
using ret_type = Ret;
using args_type = std::tuple<Args...>;
};

// No first_type_t due to
// https://open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#1430.
template <typename T, typename... Ts> struct first_type {
Expand Down
22 changes: 0 additions & 22 deletions sycl/test/type_traits/type_traits.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,6 @@ void test_remove_pointer_t() {
"");
}

template <typename T, typename SpaceList, bool Expected = true>
void test_is_address_space_compliant() {
static_assert(d::is_address_space_compliant<T, SpaceList>::value == Expected,
"");
}

template <typename T, int Checked, bool Expected = true>
void test_vector_size() {
static_assert((d::vector_size<T>::value == Checked) == Expected, "");
Expand All @@ -102,22 +96,6 @@ int main() {
test_remove_pointer_t<s::constant_ptr<s::int2>, s::int2>();
test_remove_pointer_t<s::constant_ptr<s::float2>, s::float2>();

test_is_address_space_compliant<int *, d::gvl::nonconst_address_space_list>();
test_is_address_space_compliant<float *,
d::gvl::nonconst_address_space_list>();
test_is_address_space_compliant<s::constant_ptr<int>,
d::gvl::nonconst_address_space_list, false>();
test_is_address_space_compliant<s::constant_ptr<float>,
d::gvl::nonconst_address_space_list, false>();
test_is_address_space_compliant<s::int2 *,
d::gvl::nonconst_address_space_list>();
test_is_address_space_compliant<s::float2 *,
d::gvl::nonconst_address_space_list>();
test_is_address_space_compliant<s::constant_ptr<s::int2>,
d::gvl::nonconst_address_space_list, false>();
test_is_address_space_compliant<s::constant_ptr<s::float2>,
d::gvl::nonconst_address_space_list, false>();

test_is_integral<int>();
test_is_integral<s::int2>();
test_is_integral<float, false>();
Expand Down

0 comments on commit 50ba40c

Please sign in to comment.