Skip to content

Commit 9125814

Browse files
committed
Remove dead dpnp_choose code
With new kernel implementation, it's no longer necessary
1 parent 8b8da0e commit 9125814

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
@@ -132,39 +132,6 @@ INP_DLLEXPORT void dpnp_partition_c(void *array,
132132
const shape_elem_type *shape,
133133
const size_t ndim);
134134

135-
/**
136-
* @ingroup BACKEND_API
137-
* @brief Construct an array from an index array and a list of arrays to choose
138-
* from.
139-
*
140-
* @param [in] q_ref Reference to SYCL queue.
141-
* @param [out] result1 Output array.
142-
* @param [in] array1_in Input array with data.
143-
* @param [in] choices Choice arrays.
144-
* @param [in] size Input array size.
145-
* @param [in] choices_size Choices size.
146-
* @param [in] choice_size Choice size.
147-
* @param [in] dep_event_vec_ref Reference to vector of SYCL events.
148-
*/
149-
template <typename _DataType1, typename _DataType2>
150-
INP_DLLEXPORT DPCTLSyclEventRef
151-
dpnp_choose_c(DPCTLSyclQueueRef q_ref,
152-
void *result1,
153-
void *array1_in,
154-
void **choices,
155-
size_t size,
156-
size_t choices_size,
157-
size_t choice_size,
158-
const DPCTLEventVectorRef dep_event_vec_ref);
159-
160-
template <typename _DataType1, typename _DataType2>
161-
INP_DLLEXPORT void dpnp_choose_c(void *result1,
162-
void *array1_in,
163-
void **choices,
164-
size_t size,
165-
size_t choices_size,
166-
size_t choice_size);
167-
168135
/**
169136
* @ingroup BACKEND_API
170137
* @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
@@ -138,7 +138,8 @@ class dpnp_less_comp
138138
ret = (b.imag() != b.imag() && a.imag() == a.imag());
139139
}
140140
else if (a.real() == b.real() ||
141-
(a.real() != a.real() && b.real() != b.real())) {
141+
(a.real() != a.real() && b.real() != b.real()))
142+
{
142143
ret = (a.imag() < b.imag() ||
143144
(b.imag() != b.imag() && a.imag() == a.imag()));
144145
}
@@ -158,7 +159,6 @@ class dpnp_less_comp
158159
*/
159160
void func_map_init_arraycreation(func_map_t &fmap);
160161
void func_map_init_elemwise(func_map_t &fmap);
161-
void func_map_init_indexing_func(func_map_t &fmap);
162162
void func_map_init_linalg(func_map_t &fmap);
163163
void func_map_init_mathematical(func_map_t &fmap);
164164
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
@@ -97,7 +97,6 @@ static func_map_t func_map_init()
9797

9898
func_map_init_arraycreation(fmap);
9999
func_map_init_elemwise(fmap);
100-
func_map_init_indexing_func(fmap);
101100
func_map_init_linalg(fmap);
102101
func_map_init_mathematical(fmap);
103102
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)