Skip to content

Commit 14d5771

Browse files
[NFC][SYCL] Drop unused traits (#16912)
1 parent b48f41a commit 14d5771

File tree

2 files changed

+0
-41
lines changed

2 files changed

+0
-41
lines changed

sycl/include/sycl/builtins_utils_scalar.hpp

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,6 @@ template <typename> struct use_fast_math : std::false_type {};
3232
#endif
3333
template <typename T> constexpr bool use_fast_math_v = use_fast_math<T>::value;
3434

35-
// Common utility for selecting a type based on the specified size.
36-
template <size_t Size, typename T8, typename T16, typename T32, typename T64>
37-
using select_scalar_by_size_t = std::conditional_t<
38-
Size == 1, T8,
39-
std::conditional_t<
40-
Size == 2, T16,
41-
std::conditional_t<Size == 4, T32,
42-
std::conditional_t<Size == 8, T64, void>>>>;
43-
4435
template <size_t N, size_t... Ns> constexpr bool CheckSizeIn() {
4536
constexpr bool SameSize[] = {(N == Ns)...};
4637
// Replace with std::any_of with C++20.
@@ -50,32 +41,6 @@ template <size_t N, size_t... Ns> constexpr bool CheckSizeIn() {
5041
return false;
5142
}
5243

53-
// Checks if the type of the operation is the same. For scalars and marray that
54-
// requires the types to be exact matches. For vector and swizzles it requires
55-
// that the corresponding vector conversion is the same.
56-
template <typename T1, typename T2, typename = void>
57-
struct is_same_op : std::is_same<T1, T2> {};
58-
59-
template <typename T1, typename T2>
60-
constexpr bool is_same_op_v = is_same_op<T1, T2>::value;
61-
62-
// Constexpr function for checking that all types are the same, considering
63-
// swizzles and vectors the same if they have the same number of elements and
64-
// the same element type.
65-
template <typename T, typename... Ts> constexpr bool CheckAllSameOpType() {
66-
constexpr bool SameType[] = {
67-
is_same_op_v<std::remove_cv_t<T>, std::remove_cv_t<Ts>>...};
68-
// Replace with std::all_of with C++20.
69-
for (size_t I = 0; I < sizeof...(Ts); ++I)
70-
if (!SameType[I])
71-
return false;
72-
return true;
73-
}
74-
75-
// NOTE: We need a constexpr variable definition for the constexpr functions
76-
// as MSVC thinks function definitions are the same otherwise.
77-
template <typename... Ts>
78-
constexpr bool check_all_same_op_type_v = CheckAllSameOpType<Ts...>();
7944
// NOTE: We need a constexpr variable definition for the constexpr functions
8045
// as MSVC thinks function definitions are the same otherwise.
8146
template <size_t... Ns> constexpr bool check_size_in_v = CheckSizeIn<Ns...>();

sycl/include/sycl/builtins_utils_vec.hpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,6 @@ struct simplify_if_swizzle<SwizzleOp<VecT, OperationLeftT, OperationRightT,
3838
using type = vec<typename VecT::element_type, sizeof...(Indexes)>;
3939
};
4040

41-
template <typename T1, typename T2>
42-
struct is_same_op<
43-
T1, T2,
44-
std::enable_if_t<is_vec_or_swizzle_v<T1> && is_vec_or_swizzle_v<T2>>>
45-
: std::is_same<simplify_if_swizzle_t<T1>, simplify_if_swizzle_t<T2>> {};
46-
4741
// Utility trait for changing the element type of a type T. If T is a scalar,
4842
// the new type replaces T completely.
4943
template <typename NewElemT, typename T> struct change_elements {

0 commit comments

Comments
 (0)