Skip to content

Commit 03b585b

Browse files
authored
Clean up legacy indexing implementation from the backend (#1908)
* Clean up legacy indexing implementation from the backend * fix pre-commit
1 parent 2fff1f1 commit 03b585b

File tree

3 files changed

+21
-1019
lines changed

3 files changed

+21
-1019
lines changed

dpnp/backend/include/dpnp_iface.hpp

Lines changed: 0 additions & 224 deletions
Original file line numberDiff line numberDiff line change
@@ -205,38 +205,6 @@ INP_DLLEXPORT void dpnp_nanvar_c(void *array,
205205
const size_t result_size,
206206
size_t size);
207207

208-
/**
209-
* @ingroup BACKEND_API
210-
* @brief Return the indices of the elements that are non-zero.
211-
*
212-
* @param [in] q_ref Reference to SYCL queue.
213-
* @param [in] array1 Input array.
214-
* @param [out] result1 Output array.
215-
* @param [in] result_size Output array size.
216-
* @param [in] shape Shape of input array.
217-
* @param [in] ndim Number of elements in shape.
218-
* @param [in] j Number input array.
219-
* @param [in] dep_event_vec_ref Reference to vector of SYCL events.
220-
*/
221-
template <typename _DataType>
222-
INP_DLLEXPORT DPCTLSyclEventRef
223-
dpnp_nonzero_c(DPCTLSyclQueueRef q_ref,
224-
const void *array1,
225-
void *result1,
226-
const size_t result_size,
227-
const shape_elem_type *shape,
228-
const size_t ndim,
229-
const size_t j,
230-
const DPCTLEventVectorRef dep_event_vec_ref);
231-
232-
template <typename _DataType>
233-
INP_DLLEXPORT void dpnp_nonzero_c(const void *array1,
234-
void *result1,
235-
const size_t result_size,
236-
const shape_elem_type *shape,
237-
const size_t ndim,
238-
const size_t j);
239-
240208
/**
241209
* @ingroup BACKEND_API
242210
* @brief Custom implementation of dot function
@@ -448,35 +416,6 @@ INP_DLLEXPORT void dpnp_partition_c(void *array,
448416
const shape_elem_type *shape,
449417
const size_t ndim);
450418

451-
/**
452-
* @ingroup BACKEND_API
453-
* @brief Place of array elements
454-
*
455-
* @param [in] q_ref Reference to SYCL queue.
456-
* @param [in] arr Input array.
457-
* @param [in] mask Mask array.
458-
* @param [in] vals Vals array.
459-
* @param [in] arr_size Number of input elements in `arr`.
460-
* @param [in] vals_size Number of input elements in `vals`.
461-
* @param [in] dep_event_vec_ref Reference to vector of SYCL events.
462-
*/
463-
template <typename _DataType>
464-
INP_DLLEXPORT DPCTLSyclEventRef
465-
dpnp_place_c(DPCTLSyclQueueRef q_ref,
466-
void *arr,
467-
long *mask,
468-
void *vals,
469-
const size_t arr_size,
470-
const size_t vals_size,
471-
const DPCTLEventVectorRef dep_event_vec_ref);
472-
473-
template <typename _DataType>
474-
INP_DLLEXPORT void dpnp_place_c(void *arr,
475-
long *mask,
476-
void *vals,
477-
const size_t arr_size,
478-
const size_t vals_size);
479-
480419
/**
481420
* @ingroup BACKEND_API
482421
* @brief Compute Product of input array elements.
@@ -523,78 +462,6 @@ INP_DLLEXPORT void dpnp_prod_c(void *result_out,
523462
const void *initial,
524463
const long *where);
525464

526-
/**
527-
* @ingroup BACKEND_API
528-
* @brief Replaces specified elements of an array with given values.
529-
*
530-
* @param [in] q_ref Reference to SYCL queue.
531-
* @param [in] array Input array.
532-
* @param [in] ind Target indices, interpreted as integers.
533-
* @param [in] v Values to place in array at target indices.
534-
* @param [in] size Number of input elements in `array`.
535-
* @param [in] size_ind Number of input elements in `ind`.
536-
* @param [in] size_v Number of input elements in `v`.
537-
* @param [in] dep_event_vec_ref Reference to vector of SYCL events.
538-
*/
539-
template <typename _DataType, typename _IndecesType, typename _ValueType>
540-
INP_DLLEXPORT DPCTLSyclEventRef
541-
dpnp_put_c(DPCTLSyclQueueRef q_ref,
542-
void *array,
543-
void *ind,
544-
void *v,
545-
const size_t size,
546-
const size_t size_ind,
547-
const size_t size_v,
548-
const DPCTLEventVectorRef dep_event_vec_ref);
549-
550-
template <typename _DataType, typename _IndecesType, typename _ValueType>
551-
INP_DLLEXPORT void dpnp_put_c(void *array,
552-
void *ind,
553-
void *v,
554-
const size_t size,
555-
const size_t size_ind,
556-
const size_t size_v);
557-
558-
/**
559-
* @ingroup BACKEND_API
560-
* @brief Put values into the destination array by matching 1d index and data
561-
* slices.
562-
*
563-
* @param [in] q_ref Reference to SYCL queue.
564-
* @param [in] arr_in Input array.
565-
* @param [in] indices_in Indices to change along each 1d slice of
566-
* arr.
567-
* @param [in] values_in Values to insert at those indices.
568-
* @param [in] axis The axis to take 1d slices along.
569-
* @param [in] shape Shape of input array.
570-
* @param [in] ndim Number of input array dimensions.
571-
* @param [in] size_indices Size of indices.
572-
* @param [in] values_size Size of values.
573-
* @param [in] dep_event_vec_ref Reference to vector of SYCL events.
574-
*/
575-
template <typename _DataType>
576-
INP_DLLEXPORT DPCTLSyclEventRef
577-
dpnp_put_along_axis_c(DPCTLSyclQueueRef q_ref,
578-
void *arr_in,
579-
long *indices_in,
580-
void *values_in,
581-
size_t axis,
582-
const shape_elem_type *shape,
583-
size_t ndim,
584-
size_t size_indices,
585-
size_t values_size,
586-
const DPCTLEventVectorRef dep_event_vec_ref);
587-
588-
template <typename _DataType>
589-
INP_DLLEXPORT void dpnp_put_along_axis_c(void *arr_in,
590-
long *indices_in,
591-
void *values_in,
592-
size_t axis,
593-
const shape_elem_type *shape,
594-
size_t ndim,
595-
size_t size_indices,
596-
size_t values_size);
597-
598465
/**
599466
* @ingroup BACKEND_API
600467
@@ -776,42 +643,6 @@ INP_DLLEXPORT void dpnp_choose_c(void *result1,
776643
size_t choices_size,
777644
size_t choice_size);
778645

779-
/**
780-
* @ingroup BACKEND_API
781-
* @brief math library implementation of diagonal function
782-
*
783-
* @param [in] q_ref Reference to SYCL queue.
784-
* @param [in] array1_in Input array with data.
785-
* @param [in] input1_size Input1 data size.
786-
* @param [out] result1 Output array.
787-
* @param [in] offset Offset of the diagonal from the main
788-
* diagonal.
789-
* @param [in] shape Shape of input array.
790-
* @param [in] res_shape Shape of output array.
791-
* @param [in] res_ndim Number of elements in shape.
792-
* @param [in] dep_event_vec_ref Reference to vector of SYCL events.
793-
*/
794-
template <typename _DataType>
795-
INP_DLLEXPORT DPCTLSyclEventRef
796-
dpnp_diagonal_c(DPCTLSyclQueueRef q_ref,
797-
void *array1_in,
798-
const size_t input1_size,
799-
void *result1,
800-
const size_t offset,
801-
shape_elem_type *shape,
802-
shape_elem_type *res_shape,
803-
const size_t res_ndim,
804-
const DPCTLEventVectorRef dep_event_vec_ref);
805-
806-
template <typename _DataType>
807-
INP_DLLEXPORT void dpnp_diagonal_c(void *array1_in,
808-
const size_t input1_size,
809-
void *result1,
810-
const size_t offset,
811-
shape_elem_type *shape,
812-
shape_elem_type *res_shape,
813-
const size_t res_ndim);
814-
815646
/**
816647
* @ingroup BACKEND_API
817648
* @brief implementation of creating filled with value array function
@@ -1044,35 +875,6 @@ INP_DLLEXPORT void dpnp_std_c(void *array,
1044875
size_t naxis,
1045876
size_t ddof);
1046877

1047-
/**
1048-
* @ingroup BACKEND_API
1049-
* @brief math library implementation of take function
1050-
*
1051-
* @param [in] q_ref Reference to SYCL queue.
1052-
* @param [in] array Input array with data.
1053-
* @param [in] array1_size Input array size.
1054-
* @param [in] indices Input array with indices.
1055-
* @param [out] result Output array.
1056-
* @param [in] size Number of elements in the input array.
1057-
* @param [in] dep_event_vec_ref Reference to vector of SYCL events.
1058-
*/
1059-
template <typename _DataType, typename _IndecesType>
1060-
INP_DLLEXPORT DPCTLSyclEventRef
1061-
dpnp_take_c(DPCTLSyclQueueRef q_ref,
1062-
void *array,
1063-
const size_t array1_size,
1064-
void *indices,
1065-
void *result,
1066-
size_t size,
1067-
const DPCTLEventVectorRef dep_event_vec_ref);
1068-
1069-
template <typename _DataType, typename _IndecesType>
1070-
INP_DLLEXPORT void dpnp_take_c(void *array,
1071-
const size_t array1_size,
1072-
void *indices,
1073-
void *result,
1074-
size_t size);
1075-
1076878
/**
1077879
* @ingroup BACKEND_API
1078880
* @brief math library implementation of var function
@@ -1183,32 +985,6 @@ INP_DLLEXPORT void dpnp_var_c(void *array,
1183985

1184986
#include <dpnp_gen_2arg_3type_tbl.hpp>
1185987

1186-
/**
1187-
* @ingroup BACKEND_API
1188-
* @brief fill_diagonal function.
1189-
*
1190-
* @param [in] q_ref Reference to SYCL queue.
1191-
* @param [in] array1_in Input array.
1192-
* @param [in] val Value to write on the diagonal.
1193-
* @param [in] shape Input shape.
1194-
* @param [in] ndim Number of elements in shape.
1195-
* @param [in] dep_event_vec_ref Reference to vector of SYCL events.
1196-
*/
1197-
template <typename _DataType>
1198-
INP_DLLEXPORT DPCTLSyclEventRef
1199-
dpnp_fill_diagonal_c(DPCTLSyclQueueRef q_ref,
1200-
void *array1_in,
1201-
void *val,
1202-
shape_elem_type *shape,
1203-
const size_t ndim,
1204-
const DPCTLEventVectorRef dep_event_vec_ref);
1205-
1206-
template <typename _DataType>
1207-
INP_DLLEXPORT void dpnp_fill_diagonal_c(void *array1_in,
1208-
void *val,
1209-
shape_elem_type *shape,
1210-
const size_t ndim);
1211-
1212988
/**
1213989
* @ingroup BACKEND_API
1214990
* @brief modf function.

dpnp/backend/include/dpnp_iface_fptr.hpp

Lines changed: 21 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -81,22 +81,20 @@ enum class DPNPFuncName : size_t
8181
DPNP_FN_DEGREES, /**< Used in numpy.degrees() impl */
8282
DPNP_FN_DEGREES_EXT, /**< Used in numpy.degrees() impl, requires extra
8383
parameters */
84-
DPNP_FN_DIAGONAL, /**< Used in numpy.diagonal() impl */
8584
DPNP_FN_DOT, /**< Used in numpy.dot() impl */
8685
DPNP_FN_DOT_EXT, /**< Used in numpy.dot() impl, requires extra parameters */
8786
DPNP_FN_EDIFF1D, /**< Used in numpy.ediff1d() impl */
88-
DPNP_FN_EDIFF1D_EXT, /**< Used in numpy.ediff1d() impl, requires extra
89-
parameters */
90-
DPNP_FN_ERF, /**< Used in scipy.special.erf impl */
91-
DPNP_FN_ERF_EXT, /**< Used in scipy.special.erf impl, requires extra
92-
parameters */
93-
DPNP_FN_FFT_FFT, /**< Used in numpy.fft.fft() impl */
94-
DPNP_FN_FFT_FFT_EXT, /**< Used in numpy.fft.fft() impl, requires extra
95-
parameters */
96-
DPNP_FN_FFT_RFFT, /**< Used in numpy.fft.rfft() impl */
97-
DPNP_FN_FFT_RFFT_EXT, /**< Used in numpy.fft.rfft() impl, requires extra
98-
parameters */
99-
DPNP_FN_FILL_DIAGONAL, /**< Used in numpy.fill_diagonal() impl */
87+
DPNP_FN_EDIFF1D_EXT, /**< Used in numpy.ediff1d() impl, requires extra
88+
parameters */
89+
DPNP_FN_ERF, /**< Used in scipy.special.erf impl */
90+
DPNP_FN_ERF_EXT, /**< Used in scipy.special.erf impl, requires extra
91+
parameters */
92+
DPNP_FN_FFT_FFT, /**< Used in numpy.fft.fft() impl */
93+
DPNP_FN_FFT_FFT_EXT, /**< Used in numpy.fft.fft() impl, requires extra
94+
parameters */
95+
DPNP_FN_FFT_RFFT, /**< Used in numpy.fft.rfft() impl */
96+
DPNP_FN_FFT_RFFT_EXT, /**< Used in numpy.fft.rfft() impl, requires extra
97+
parameters */
10098
DPNP_FN_INITVAL, /**< Used in numpy ones, ones_like, zeros, zeros_like impls
10199
*/
102100
DPNP_FN_INITVAL_EXT, /**< Used in numpy ones, ones_like, zeros, zeros_like
@@ -116,23 +114,19 @@ enum class DPNPFuncName : size_t
116114
*/
117115
DPNP_FN_MULTIPLY, /**< Used in numpy.multiply() impl */
118116
DPNP_FN_NANVAR, /**< Used in numpy.nanvar() impl */
119-
DPNP_FN_NONZERO, /**< Used in numpy.nonzero() impl */
120117
DPNP_FN_ONES, /**< Used in numpy.ones() impl */
121118
DPNP_FN_ONES_LIKE, /**< Used in numpy.ones_like() impl */
122119
DPNP_FN_PARTITION, /**< Used in numpy.partition() impl */
123-
DPNP_FN_PARTITION_EXT, /**< Used in numpy.partition() impl, requires extra
124-
parameters */
125-
DPNP_FN_PLACE, /**< Used in numpy.place() impl */
126-
DPNP_FN_PROD, /**< Used in numpy.prod() impl */
127-
DPNP_FN_PUT, /**< Used in numpy.put() impl */
128-
DPNP_FN_PUT_ALONG_AXIS, /**< Used in numpy.put_along_axis() impl */
129-
DPNP_FN_RADIANS, /**< Used in numpy.radians() impl */
130-
DPNP_FN_RADIANS_EXT, /**< Used in numpy.radians() impl, requires extra
131-
parameters */
132-
DPNP_FN_RNG_BETA, /**< Used in numpy.random.beta() impl */
133-
DPNP_FN_RNG_BETA_EXT, /**< Used in numpy.random.beta() impl, requires extra
134-
parameters */
135-
DPNP_FN_RNG_BINOMIAL, /**< Used in numpy.random.binomial() impl */
120+
DPNP_FN_PARTITION_EXT, /**< Used in numpy.partition() impl, requires extra
121+
parameters */
122+
DPNP_FN_PROD, /**< Used in numpy.prod() impl */
123+
DPNP_FN_RADIANS, /**< Used in numpy.radians() impl */
124+
DPNP_FN_RADIANS_EXT, /**< Used in numpy.radians() impl, requires extra
125+
parameters */
126+
DPNP_FN_RNG_BETA, /**< Used in numpy.random.beta() impl */
127+
DPNP_FN_RNG_BETA_EXT, /**< Used in numpy.random.beta() impl, requires extra
128+
parameters */
129+
DPNP_FN_RNG_BINOMIAL, /**< Used in numpy.random.binomial() impl */
136130
DPNP_FN_RNG_BINOMIAL_EXT, /**< Used in numpy.random.binomial() impl,
137131
requires extra parameters */
138132
DPNP_FN_RNG_CHISQUARE, /**< Used in numpy.random.chisquare() impl */
@@ -253,7 +247,6 @@ enum class DPNPFuncName : size_t
253247
*/
254248
DPNP_FN_STD, /**< Used in numpy.std() impl */
255249
DPNP_FN_SUM, /**< Used in numpy.sum() impl */
256-
DPNP_FN_TAKE, /**< Used in numpy.take() impl */
257250
DPNP_FN_VAR, /**< Used in numpy.var() impl */
258251
DPNP_FN_ZEROS, /**< Used in numpy.zeros() impl */
259252
DPNP_FN_ZEROS_LIKE, /**< Used in numpy.zeros_like() impl */

0 commit comments

Comments
 (0)