@@ -69,93 +69,6 @@ const DPNPFuncType eft_C64 = DPNPFuncType::DPNP_FT_CMPLX64;
6969const DPNPFuncType eft_C128 = DPNPFuncType::DPNP_FT_CMPLX128;
7070const DPNPFuncType eft_BLN = DPNPFuncType::DPNP_FT_BOOL;
7171
72- /* *
73- * An internal structure to build a pair of Data type enum value with C++ type
74- */
75- template <DPNPFuncType FuncType, typename T>
76- struct func_type_pair_t
77- {
78- using type = T;
79-
80- static func_type_pair_t
81- get_pair (std::integral_constant<DPNPFuncType, FuncType>)
82- {
83- return {};
84- }
85- };
86-
87- /* *
88- * An internal structure to create a map of Data type enum value associated with
89- * C++ type
90- */
91- template <typename ... Ps>
92- struct func_type_map_factory_t : public Ps ...
93- {
94- using Ps::get_pair...;
95-
96- template <DPNPFuncType FuncType>
97- using find_type = typename decltype (get_pair(
98- std::integral_constant<DPNPFuncType, FuncType>{}))::type;
99- };
100-
101- /* *
102- * A map of the FPTR interface to link Data type enum value with associated C++
103- * type
104- */
105- typedef func_type_map_factory_t <
106- func_type_pair_t <eft_BLN, bool >,
107- func_type_pair_t <eft_INT, std::int32_t >,
108- func_type_pair_t <eft_LNG, std::int64_t >,
109- func_type_pair_t <eft_FLT, float >,
110- func_type_pair_t <eft_DBL, double >,
111- func_type_pair_t <eft_C64, std::complex <float >>,
112- func_type_pair_t <eft_C128, std::complex <double >>>
113- func_type_map_t ;
114-
115- /* *
116- * Return an enum value of result type populated from input types.
117- */
118- template <DPNPFuncType FT1, DPNPFuncType FT2>
119- static constexpr DPNPFuncType populate_func_types ()
120- {
121- if constexpr (FT1 == DPNPFuncType::DPNP_FT_NONE) {
122- throw std::runtime_error (" Templated enum value of FT1 is None" );
123- }
124- else if constexpr (FT2 == DPNPFuncType::DPNP_FT_NONE) {
125- throw std::runtime_error (" Templated enum value of FT2 is None" );
126- }
127- return (FT1 < FT2) ? FT2 : FT1;
128- }
129-
130- /* *
131- * @brief A helper function to cast SYCL vector between types.
132- */
133- template <typename Op, typename Vec, std::size_t ... I>
134- static auto dpnp_vec_cast_impl (const Vec &v, std::index_sequence<I...>)
135- {
136- return Op{v[I]...};
137- }
138-
139- /* *
140- * @brief A casting function for SYCL vector.
141- *
142- * @tparam dstT A result type upon casting.
143- * @tparam srcT An incoming type of the vector.
144- * @tparam N A number of elements with the vector.
145- * @tparam Indices A sequence of integers
146- * @param s An incoming SYCL vector to cast.
147- * @return SYCL vector casted to desctination type.
148- */
149- template <typename dstT,
150- typename srcT,
151- std::size_t N,
152- typename Indices = std::make_index_sequence<N>>
153- static auto dpnp_vec_cast (const sycl::vec<srcT, N> &s)
154- {
155- return dpnp_vec_cast_impl<sycl::vec<dstT, N>, sycl::vec<srcT, N>>(
156- s, Indices{});
157- }
158-
15972/* *
16073 * Implements std::is_same<> with variadic number of types to compare with
16174 * and when type T has to match only one of types Ts.
@@ -188,21 +101,6 @@ template <typename T1, typename T2, typename... Ts>
188101constexpr auto both_types_are_same =
189102 std::conjunction_v<is_any<T1, Ts...>, are_same<T1, T2>>;
190103
191- /* *
192- * A template constat to check if both types T1 and T2 match any type from Ts.
193- */
194- template <typename T1, typename T2, typename ... Ts>
195- constexpr auto both_types_are_any_of =
196- std::conjunction_v<is_any<T1, Ts...>, is_any<T2, Ts...>>;
197-
198- /* *
199- * A template constat to check if both types T1 and T2 don't match any type from
200- * Ts sequence.
201- */
202- template <typename T1, typename T2, typename ... Ts>
203- constexpr auto none_of_both_types =
204- !std::disjunction_v<is_any<T1, Ts...>, is_any<T2, Ts...>>;
205-
206104/* *
207105 * @brief If the type _Tp is a reference type, provides the member typedef type
208106 * which is the type referred to by _Tp with its topmost cv-qualifiers removed.
0 commit comments