Skip to content

Commit f294dfd

Browse files
authored
Reuse logical operations from dpctl.tensor (#1464)
* Reuse logical operations from dpctl.tensor * Apply the comment * Removed unused backend code
1 parent fd9ce2b commit f294dfd

File tree

9 files changed

+368
-488
lines changed

9 files changed

+368
-488
lines changed

dpnp/backend/include/dpnp_gen_1arg_1type_tbl.hpp

Lines changed: 2 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -104,60 +104,6 @@ MACRO_1ARG_1TYPE_OP(dpnp_square_c,
104104

105105
#undef MACRO_1ARG_1TYPE_OP
106106

107-
#elif defined(MACRO_1ARG_1TYPE_LOGIC_OP)
108-
109-
/*
110-
* This header file contains single argument element wise functions definitions
111-
*
112-
* Macro `MACRO_1ARG_1TYPE_LOGIC_OP` must be defined before usage
113-
*
114-
* Parameters:
115-
* - public name of the function and kernel name
116-
* - operation used to calculate the result
117-
*
118-
*/
119-
120-
#ifdef _SECTION_DOCUMENTATION_GENERATION_
121-
122-
#define MACRO_1ARG_1TYPE_LOGIC_OP(__name__, __operation__) \
123-
/** @ingroup BACKEND_API */ \
124-
/** @brief Per element operation function __name__ */ \
125-
/** */ \
126-
/** Function "__name__" executes operator "__operation__" over \
127-
* corresponding elements of input array */ \
128-
/** */ \
129-
/** @param[in] q_ref Reference to SYCL queue. */ \
130-
/** @param[out] result_out Output array. */ \
131-
/** @param[in] result_size Output array size. */ \
132-
/** @param[in] result_ndim Number of output array \
133-
* dimensions. */ \
134-
/** @param[in] result_shape Output array shape. */ \
135-
/** @param[in] result_strides Output array strides. */ \
136-
/** @param[in] input1_in Input array 1. */ \
137-
/** @param[in] input1_size Input array 1 size. */ \
138-
/** @param[in] input1_ndim Number of input array 1 \
139-
* dimensions. */ \
140-
/** @param[in] input1_shape Input array 1 shape. */ \
141-
/** @param[in] input1_strides Input array 1 strides. */ \
142-
/** @param[in] where Where condition. */ \
143-
/** @param[in] dep_event_vec_ref Reference to vector of SYCL \
144-
* events. */ \
145-
template <typename _DataType_input1> \
146-
DPCTLSyclEventRef __name__( \
147-
DPCTLSyclQueueRef q_ref, void *result_out, const size_t result_size, \
148-
const size_t result_ndim, const shape_elem_type *result_shape, \
149-
const shape_elem_type *result_strides, const void *input1_in, \
150-
const size_t input1_size, const size_t input1_ndim, \
151-
const shape_elem_type *input1_shape, \
152-
const shape_elem_type *input1_strides, const size_t *where, \
153-
const DPCTLEventVectorRef dep_event_vec_ref);
154-
155-
#endif // _SECTION_DOCUMENTATION_GENERATION_
156-
157-
MACRO_1ARG_1TYPE_LOGIC_OP(dpnp_logical_not_c, !input1_elem)
158-
159-
#undef MACRO_1ARG_1TYPE_LOGIC_OP
160-
161107
#else
162-
#error "MACRO_1ARG_1TYPE_OP or MACRO_1ARG_1TYPE_LOGIC_OP is not defined"
163-
#endif // MACRO_1ARG_1TYPE_OP || MACRO_1ARG_1TYPE_LOGIC_OP
108+
#error "MACRO_1ARG_1TYPE_OP is not defined"
109+
#endif // MACRO_1ARG_1TYPE_OP

dpnp/backend/include/dpnp_gen_2arg_2type_tbl.hpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,6 @@ MACRO_2ARG_2TYPES_LOGIC_OP(dpnp_greater_c, input1_elem > input2_elem)
8989
MACRO_2ARG_2TYPES_LOGIC_OP(dpnp_greater_equal_c, input1_elem >= input2_elem)
9090
MACRO_2ARG_2TYPES_LOGIC_OP(dpnp_less_c, input1_elem < input2_elem)
9191
MACRO_2ARG_2TYPES_LOGIC_OP(dpnp_less_equal_c, input1_elem <= input2_elem)
92-
MACRO_2ARG_2TYPES_LOGIC_OP(dpnp_logical_and_c, input1_elem &&input2_elem)
93-
MACRO_2ARG_2TYPES_LOGIC_OP(dpnp_logical_or_c, input1_elem || input2_elem)
94-
MACRO_2ARG_2TYPES_LOGIC_OP(dpnp_logical_xor_c,
95-
(!!input1_elem) != (!!input2_elem))
9692
MACRO_2ARG_2TYPES_LOGIC_OP(dpnp_not_equal_c, input1_elem != input2_elem)
9793

9894
#undef MACRO_2ARG_2TYPES_LOGIC_OP

dpnp/backend/include/dpnp_iface_fptr.hpp

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -270,15 +270,7 @@ enum class DPNPFuncName : size_t
270270
DPNP_FN_LOG1P, /**< Used in numpy.log1p() impl */
271271
DPNP_FN_LOG1P_EXT, /**< Used in numpy.log1p() impl, requires extra
272272
parameters */
273-
DPNP_FN_LOGICAL_AND_EXT, /**< Used in numpy.logical_and() impl, requires
274-
extra parameters */
275-
DPNP_FN_LOGICAL_NOT_EXT, /**< Used in numpy.logical_not() impl, requires
276-
extra parameters */
277-
DPNP_FN_LOGICAL_OR_EXT, /**< Used in numpy.logical_or() impl, requires extra
278-
parameters */
279-
DPNP_FN_LOGICAL_XOR_EXT, /**< Used in numpy.logical_xor() impl, requires
280-
extra parameters */
281-
DPNP_FN_MATMUL, /**< Used in numpy.matmul() impl */
273+
DPNP_FN_MATMUL, /**< Used in numpy.matmul() impl */
282274
DPNP_FN_MATMUL_EXT, /**< Used in numpy.matmul() impl, requires extra
283275
parameters */
284276
DPNP_FN_MATRIX_RANK, /**< Used in numpy.linalg.matrix_rank() impl */

0 commit comments

Comments
 (0)