Skip to content

Commit ce3ef5e

Browse files
authored
Clean up backend code (#2259)
The PR proposed to remove unused code from the backend. Specially it's about removing local constant `striped` which produces compilation warnings.
1 parent 44bb068 commit ce3ef5e

File tree

3 files changed

+0
-151
lines changed

3 files changed

+0
-151
lines changed

dpnp/backend/kernels/dpnp_krnl_elemwise.cpp

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -30,23 +30,9 @@
3030
#include <dpnp_iface.hpp>
3131

3232
#include "dpnp_fptr.hpp"
33-
#include "dpnp_iterator.hpp"
3433
#include "dpnp_utils.hpp"
35-
#include "dpnpc_memory_adapter.hpp"
3634
#include "queue_sycl.hpp"
3735

38-
// dpctl tensor headers
39-
#include "kernels/alignment.hpp"
40-
41-
using dpctl::tensor::kernels::alignment_utils::is_aligned;
42-
using dpctl::tensor::kernels::alignment_utils::required_alignment;
43-
44-
namespace syclex = sycl::ext::oneapi::experimental;
45-
using syclex::group_load;
46-
using syclex::group_store;
47-
48-
constexpr auto striped = syclex::properties{syclex::data_placement_striped};
49-
5036
template <typename T>
5137
constexpr T dispatch_erf_op(T elem)
5238
{

dpnp/backend/src/dpnp_fptr.hpp

Lines changed: 0 additions & 102 deletions
Original file line numberDiff line numberDiff line change
@@ -69,93 +69,6 @@ const DPNPFuncType eft_C64 = DPNPFuncType::DPNP_FT_CMPLX64;
6969
const DPNPFuncType eft_C128 = DPNPFuncType::DPNP_FT_CMPLX128;
7070
const 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>
188101
constexpr 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.

dpnp/backend/src/dpnp_utils.hpp

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -54,15 +54,6 @@
5454
#define __SYCL_COMPILER_VECTOR_ABS_CHANGED 20230503L
5555
#endif
5656

57-
/**
58-
* Version of SYCL DPC++ 2023 compiler at which transition to SYCL 2020 occurs.
59-
* Intel(R) oneAPI DPC++ 2022.2.1 compiler has version 20221020L on Linux and
60-
* 20221101L on Windows.
61-
*/
62-
#ifndef __SYCL_COMPILER_VERSION_REQUIRED
63-
#define __SYCL_COMPILER_VERSION_REQUIRED 20221102L
64-
#endif
65-
6657
/**
6758
* Version of Intel MKL at which transition to OneMKL release 2023.0.0 occurs.
6859
*/
@@ -221,32 +212,6 @@ static inline bool array_equal(const _DataType *input1,
221212
std::begin(input2_vec));
222213
}
223214

224-
/**
225-
* @ingroup BACKEND_UTILS
226-
* @brief Cast vector of DPCtl events to vector of SYCL enents.
227-
*
228-
* @param [in] events_ref Reference to vector of DPCtl events.
229-
*
230-
* @return Vector of SYCL events.
231-
*/
232-
namespace
233-
{
234-
[[maybe_unused]] std::vector<sycl::event>
235-
cast_event_vector(const DPCTLEventVectorRef event_vec_ref)
236-
{
237-
const size_t event_vec_size = DPCTLEventVector_Size(event_vec_ref);
238-
239-
std::vector<sycl::event> event_vec;
240-
event_vec.reserve(event_vec_size);
241-
for (size_t i = 0; i < event_vec_size; ++i) {
242-
DPCTLSyclEventRef event_ref = DPCTLEventVector_GetAt(event_vec_ref, i);
243-
sycl::event event = *(reinterpret_cast<sycl::event *>(event_ref));
244-
event_vec.push_back(event);
245-
}
246-
return event_vec;
247-
}
248-
} // namespace
249-
250215
/**
251216
* @ingroup BACKEND_UTILS
252217
* @brief Normalizes an axes into a non-negative integer axes.

0 commit comments

Comments
 (0)