1
1
// *****************************************************************************
2
- // Copyright (c) 2016-2020 , Intel Corporation
2
+ // Copyright (c) 2016-2023 , Intel Corporation
3
3
// All rights reserved.
4
4
//
5
5
// Redistribution and use in source and binary forms, with or without
23
23
// THE POSSIBILITY OF SUCH DAMAGE.
24
24
// *****************************************************************************
25
25
26
+ #if defined(MACRO_1ARG_1TYPE_OP)
27
+
26
28
/*
27
29
* This header file contains single argument element wise functions definitions
28
30
*
35
37
*
36
38
*/
37
39
38
- #ifndef MACRO_1ARG_1TYPE_OP
39
- #error "MACRO_1ARG_1TYPE_OP is not defined"
40
- #endif
41
-
42
40
#ifdef _SECTION_DOCUMENTATION_GENERATION_
43
41
44
42
#define MACRO_1ARG_1TYPE_OP (__name__, __operation1__, __operation2__ ) \
88
86
const shape_elem_type* input1_strides, \
89
87
const size_t * where);
90
88
91
- #endif
89
+ #endif // _SECTION_DOCUMENTATION_GENERATION_
92
90
93
91
MACRO_1ARG_1TYPE_OP (dpnp_conjugate_c, std::conj(input_elem), q.submit(kernel_func))
94
92
MACRO_1ARG_1TYPE_OP(dpnp_copy_c, input_elem, q.submit(kernel_func))
@@ -107,3 +105,62 @@ MACRO_1ARG_1TYPE_OP(dpnp_square_c,
107
105
oneapi::mkl::vm::sqr (q, input1_size, input1_data, result))
108
106
109
107
#undef MACRO_1ARG_1TYPE_OP
108
+
109
+ #elif defined(MACRO_1ARG_1TYPE_LOGIC_OP)
110
+
111
+ /*
112
+ * This header file contains single argument element wise functions definitions
113
+ *
114
+ * Macro `MACRO_1ARG_1TYPE_LOGIC_OP` must be defined before usage
115
+ *
116
+ * Parameters:
117
+ * - public name of the function and kernel name
118
+ * - operation used to calculate the result
119
+ *
120
+ */
121
+
122
+ #ifdef _SECTION_DOCUMENTATION_GENERATION_
123
+
124
+ #define MACRO_1ARG_1TYPE_LOGIC_OP (__name__, __operation__ ) \
125
+ /* * @ingroup BACKEND_API */ \
126
+ /* * @brief Per element operation function __name__ */ \
127
+ /* * */ \
128
+ /* * Function "__name__" executes operator "__operation__" over corresponding elements of input array */ \
129
+ /* * */ \
130
+ /* * @param[in] q_ref Reference to SYCL queue. */ \
131
+ /* * @param[out] result_out Output array. */ \
132
+ /* * @param[in] result_size Output array size. */ \
133
+ /* * @param[in] result_ndim Number of output array 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 dimensions. */ \
139
+ /* * @param[in] input1_shape Input array 1 shape. */ \
140
+ /* * @param[in] input1_strides Input array 1 strides. */ \
141
+ /* * @param[in] where Where condition. */ \
142
+ /* * @param[in] dep_event_vec_ref Reference to vector of SYCL events. */ \
143
+ template <typename _DataType_input1> \
144
+ DPCTLSyclEventRef __name__ (DPCTLSyclQueueRef q_ref, \
145
+ void * result_out, \
146
+ const size_t result_size, \
147
+ const size_t result_ndim, \
148
+ const shape_elem_type* result_shape, \
149
+ const shape_elem_type* result_strides, \
150
+ const void * input1_in, \
151
+ const size_t input1_size, \
152
+ const size_t input1_ndim, \
153
+ const shape_elem_type* input1_shape, \
154
+ const shape_elem_type* input1_strides, \
155
+ const size_t * where, \
156
+ const DPCTLEventVectorRef dep_event_vec_ref);
157
+
158
+ #endif // _SECTION_DOCUMENTATION_GENERATION_
159
+
160
+ MACRO_1ARG_1TYPE_LOGIC_OP (dpnp_logical_not_c, !input1_elem)
161
+
162
+ #undef MACRO_1ARG_1TYPE_LOGIC_OP
163
+
164
+ #else
165
+ #error "MACRO_1ARG_1TYPE_OP or MACRO_1ARG_1TYPE_LOGIC_OP is not defined"
166
+ #endif // MACRO_1ARG_1TYPE_OP || MACRO_1ARG_1TYPE_LOGIC_OP
0 commit comments