Skip to content

Commit 5c926ee

Browse files
committed
Remove dead dpnp_choose code
With new kernel implementation, it's no longer necessary
1 parent 3544cc2 commit 5c926ee

File tree

6 files changed

+2
-257
lines changed

6 files changed

+2
-257
lines changed

dpnp/backend/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ set(DPNP_SRC
2727
kernels/dpnp_krnl_arraycreation.cpp
2828
kernels/dpnp_krnl_common.cpp
2929
kernels/dpnp_krnl_elemwise.cpp
30-
kernels/dpnp_krnl_indexing.cpp
3130
kernels/dpnp_krnl_mathematical.cpp
3231
kernels/dpnp_krnl_random.cpp
3332
kernels/dpnp_krnl_sorting.cpp

dpnp/backend/include/dpnp_iface.hpp

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -243,39 +243,6 @@ INP_DLLEXPORT void dpnp_correlate_c(void *result_out,
243243
const size_t input2_shape_ndim,
244244
const size_t *where);
245245

246-
/**
247-
* @ingroup BACKEND_API
248-
* @brief Construct an array from an index array and a list of arrays to choose
249-
* from.
250-
*
251-
* @param [in] q_ref Reference to SYCL queue.
252-
* @param [out] result1 Output array.
253-
* @param [in] array1_in Input array with data.
254-
* @param [in] choices Choice arrays.
255-
* @param [in] size Input array size.
256-
* @param [in] choices_size Choices size.
257-
* @param [in] choice_size Choice size.
258-
* @param [in] dep_event_vec_ref Reference to vector of SYCL events.
259-
*/
260-
template <typename _DataType1, typename _DataType2>
261-
INP_DLLEXPORT DPCTLSyclEventRef
262-
dpnp_choose_c(DPCTLSyclQueueRef q_ref,
263-
void *result1,
264-
void *array1_in,
265-
void **choices,
266-
size_t size,
267-
size_t choices_size,
268-
size_t choice_size,
269-
const DPCTLEventVectorRef dep_event_vec_ref);
270-
271-
template <typename _DataType1, typename _DataType2>
272-
INP_DLLEXPORT void dpnp_choose_c(void *result1,
273-
void *array1_in,
274-
void **choices,
275-
size_t size,
276-
size_t choices_size,
277-
size_t choice_size);
278-
279246
/**
280247
* @ingroup BACKEND_API
281248
* @brief implementation of creating filled with value array function

dpnp/backend/kernels/dpnp_krnl_indexing.cpp

Lines changed: 0 additions & 168 deletions
This file was deleted.

dpnp/backend/src/dpnp_fptr.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,8 @@ class dpnp_less_comp
246246
ret = (b.imag() != b.imag() && a.imag() == a.imag());
247247
}
248248
else if (a.real() == b.real() ||
249-
(a.real() != a.real() && b.real() != b.real())) {
249+
(a.real() != a.real() && b.real() != b.real()))
250+
{
250251
ret = (a.imag() < b.imag() ||
251252
(b.imag() != b.imag() && a.imag() == a.imag()));
252253
}
@@ -266,7 +267,6 @@ class dpnp_less_comp
266267
*/
267268
void func_map_init_arraycreation(func_map_t &fmap);
268269
void func_map_init_elemwise(func_map_t &fmap);
269-
void func_map_init_indexing_func(func_map_t &fmap);
270270
void func_map_init_linalg(func_map_t &fmap);
271271
void func_map_init_mathematical(func_map_t &fmap);
272272
void func_map_init_random(func_map_t &fmap);

dpnp/backend/src/dpnp_iface_fptr.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,6 @@ static func_map_t func_map_init()
117117

118118
func_map_init_arraycreation(fmap);
119119
func_map_init_elemwise(fmap);
120-
func_map_init_indexing_func(fmap);
121120
func_map_init_linalg(fmap);
122121
func_map_init_mathematical(fmap);
123122
func_map_init_random(fmap);

dpnp/dpnp_algo/dpnp_algo_indexing.pxi

Lines changed: 0 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -36,61 +36,9 @@ and the rest of the library
3636
# NO IMPORTs here. All imports must be placed into main "dpnp_algo.pyx" file
3737

3838
__all__ += [
39-
"dpnp_choose",
4039
"dpnp_putmask",
4140
]
4241

43-
ctypedef c_dpctl.DPCTLSyclEventRef(*fptr_dpnp_choose_t)(c_dpctl.DPCTLSyclQueueRef,
44-
void *, void * , void ** , size_t, size_t, size_t,
45-
const c_dpctl.DPCTLEventVectorRef)
46-
47-
cpdef utils.dpnp_descriptor dpnp_choose(utils.dpnp_descriptor x1, list choices1):
48-
cdef vector[void * ] choices
49-
cdef utils.dpnp_descriptor choice
50-
for desc in choices1:
51-
choice = desc
52-
choices.push_back(choice.get_data())
53-
54-
cdef shape_type_c x1_shape = x1.shape
55-
cdef size_t choice_size = choices1[0].size
56-
57-
cdef DPNPFuncType param1_type = dpnp_dtype_to_DPNPFuncType(x1.dtype)
58-
59-
cdef DPNPFuncType param2_type = dpnp_dtype_to_DPNPFuncType(choices1[0].dtype)
60-
61-
cdef DPNPFuncData kernel_data = get_dpnp_function_ptr(DPNP_FN_CHOOSE_EXT, param1_type, param2_type)
62-
63-
x1_obj = x1.get_array()
64-
65-
cdef utils.dpnp_descriptor res_array = utils.create_output_descriptor(x1_shape,
66-
kernel_data.return_type,
67-
None,
68-
device=x1_obj.sycl_device,
69-
usm_type=x1_obj.usm_type,
70-
sycl_queue=x1_obj.sycl_queue)
71-
72-
result_sycl_queue = res_array.get_array().sycl_queue
73-
74-
cdef c_dpctl.SyclQueue q = <c_dpctl.SyclQueue> result_sycl_queue
75-
cdef c_dpctl.DPCTLSyclQueueRef q_ref = q.get_queue_ref()
76-
77-
cdef fptr_dpnp_choose_t func = <fptr_dpnp_choose_t > kernel_data.ptr
78-
79-
cdef c_dpctl.DPCTLSyclEventRef event_ref = func(q_ref,
80-
res_array.get_data(),
81-
x1.get_data(),
82-
choices.data(),
83-
x1_shape[0],
84-
choices.size(),
85-
choice_size,
86-
NULL) # dep_events_ref
87-
88-
with nogil: c_dpctl.DPCTLEvent_WaitAndThrow(event_ref)
89-
c_dpctl.DPCTLEvent_Delete(event_ref)
90-
91-
return res_array
92-
93-
9442
cpdef dpnp_putmask(utils.dpnp_descriptor arr, utils.dpnp_descriptor mask, utils.dpnp_descriptor values):
9543
cdef int values_size = values.size
9644

0 commit comments

Comments
 (0)