spla
exec.hpp
Go to the documentation of this file.
1 /**********************************************************************************/
2 /* This file is part of spla project */
3 /* https://github.com/JetBrains-Research/spla */
4 /**********************************************************************************/
5 /* MIT License */
6 /* */
7 /* Copyright (c) 2023 SparseLinearAlgebra */
8 /* */
9 /* Permission is hereby granted, free of charge, to any person obtaining a copy */
10 /* of this software and associated documentation files (the "Software"), to deal */
11 /* in the Software without restriction, including without limitation the rights */
12 /* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell */
13 /* copies of the Software, and to permit persons to whom the Software is */
14 /* furnished to do so, subject to the following conditions: */
15 /* */
16 /* The above copyright notice and this permission notice shall be included in all */
17 /* copies or substantial portions of the Software. */
18 /* */
19 /* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR */
20 /* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, */
21 /* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE */
22 /* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER */
23 /* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, */
24 /* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE */
25 /* SOFTWARE. */
26 /**********************************************************************************/
27 
28 #ifndef SPLA_EXEC_HPP
29 #define SPLA_EXEC_HPP
30 
31 #include "config.hpp"
32 #include "descriptor.hpp"
33 #include "matrix.hpp"
34 #include "object.hpp"
35 #include "op.hpp"
36 #include "scalar.hpp"
37 #include "schedule.hpp"
38 #include "vector.hpp"
39 
40 namespace spla {
41 
54  ScheduleCallback callback,
55  ref_ptr<Descriptor> desc = ref_ptr<Descriptor>(),
56  ref_ptr<ScheduleTask>* task_hnd = nullptr);
57 
76  ref_ptr<Matrix> R,
77  ref_ptr<Matrix> A,
78  ref_ptr<Matrix> B,
79  ref_ptr<OpBinary> op_multiply,
80  ref_ptr<OpBinary> op_add,
81  ref_ptr<Scalar> init,
82  ref_ptr<Descriptor> desc = ref_ptr<Descriptor>(),
83  ref_ptr<ScheduleTask>* task_hnd = nullptr);
84 
105  ref_ptr<Matrix> R,
106  ref_ptr<Matrix> mask,
107  ref_ptr<Matrix> A,
108  ref_ptr<Matrix> B,
109  ref_ptr<OpBinary> op_multiply,
110  ref_ptr<OpBinary> op_add,
111  ref_ptr<OpSelect> op_select,
112  ref_ptr<Scalar> init,
113  ref_ptr<Descriptor> desc = ref_ptr<Descriptor>(),
114  ref_ptr<ScheduleTask>* task_hnd = nullptr);
115 
132  ref_ptr<Matrix> R,
133  ref_ptr<Matrix> A,
134  ref_ptr<Matrix> B,
135  ref_ptr<OpBinary> op_multiply,
136  ref_ptr<Descriptor> desc = ref_ptr<Descriptor>(),
137  ref_ptr<ScheduleTask>* task_hnd = nullptr);
138 
158  ref_ptr<Vector> r,
159  ref_ptr<Vector> mask,
160  ref_ptr<Matrix> M,
161  ref_ptr<Vector> v,
162  ref_ptr<OpBinary> op_multiply,
163  ref_ptr<OpBinary> op_add,
164  ref_ptr<OpSelect> op_select,
165  ref_ptr<Scalar> init,
166  ref_ptr<Descriptor> desc = ref_ptr<Descriptor>(),
167  ref_ptr<ScheduleTask>* task_hnd = nullptr);
168 
188  ref_ptr<Vector> r,
189  ref_ptr<Vector> mask,
190  ref_ptr<Vector> v,
191  ref_ptr<Matrix> M,
192  ref_ptr<OpBinary> op_multiply,
193  ref_ptr<OpBinary> op_add,
194  ref_ptr<OpSelect> op_select,
195  ref_ptr<Scalar> init,
196  ref_ptr<Descriptor> desc = ref_ptr<Descriptor>(),
197  ref_ptr<ScheduleTask>* task_hnd = nullptr);
198 
212  ref_ptr<Matrix> R,
213  ref_ptr<Matrix> A,
214  ref_ptr<Matrix> B,
215  ref_ptr<OpBinary> op,
216  ref_ptr<Descriptor> desc = ref_ptr<Descriptor>(),
217  ref_ptr<ScheduleTask>* task_hnd = nullptr);
218 
232  ref_ptr<Matrix> R,
233  ref_ptr<Matrix> A,
234  ref_ptr<Matrix> B,
235  ref_ptr<OpBinary> op,
236  ref_ptr<Descriptor> desc = ref_ptr<Descriptor>(),
237  ref_ptr<ScheduleTask>* task_hnd = nullptr);
238 
254  ref_ptr<Vector> r,
255  ref_ptr<Matrix> M,
256  ref_ptr<OpBinary> op_reduce,
257  ref_ptr<Scalar> init,
258  ref_ptr<Descriptor> desc = ref_ptr<Descriptor>(),
259  ref_ptr<ScheduleTask>* task_hnd = nullptr);
260 
276  ref_ptr<Vector> r,
277  ref_ptr<Matrix> M,
278  ref_ptr<OpBinary> op_reduce,
279  ref_ptr<Scalar> init,
280  ref_ptr<Descriptor> desc = ref_ptr<Descriptor>(),
281  ref_ptr<ScheduleTask>* task_hnd = nullptr);
282 
298  ref_ptr<Scalar> r,
299  ref_ptr<Scalar> s,
300  ref_ptr<Matrix> M,
301  ref_ptr<OpBinary> op_reduce,
302  ref_ptr<Descriptor> desc = ref_ptr<Descriptor>(),
303  ref_ptr<ScheduleTask>* task_hnd = nullptr);
304 
319  ref_ptr<Matrix> R,
320  ref_ptr<Matrix> M,
321  ref_ptr<OpUnary> op_apply,
322  ref_ptr<Descriptor> desc = ref_ptr<Descriptor>(),
323  ref_ptr<ScheduleTask>* task_hnd = nullptr);
324 
340  ref_ptr<Vector> r,
341  ref_ptr<Matrix> M,
342  uint index,
343  ref_ptr<OpUnary> op_apply,
344  ref_ptr<Descriptor> desc = ref_ptr<Descriptor>(),
345  ref_ptr<ScheduleTask>* task_hnd = nullptr);
346 
362  ref_ptr<Vector> r,
363  ref_ptr<Matrix> M,
364  uint index,
365  ref_ptr<OpUnary> op_apply,
366  ref_ptr<Descriptor> desc = ref_ptr<Descriptor>(),
367  ref_ptr<ScheduleTask>* task_hnd = nullptr);
368 
382  ref_ptr<Vector> r,
383  ref_ptr<Vector> u,
384  ref_ptr<Vector> v,
385  ref_ptr<OpBinary> op,
386  ref_ptr<Descriptor> desc = ref_ptr<Descriptor>(),
387  ref_ptr<ScheduleTask>* task_hnd = nullptr);
388 
402  ref_ptr<Vector> r,
403  ref_ptr<Vector> u,
404  ref_ptr<Vector> v,
405  ref_ptr<OpBinary> op,
406  ref_ptr<Descriptor> desc = ref_ptr<Descriptor>(),
407  ref_ptr<ScheduleTask>* task_hnd = nullptr);
408 
424  ref_ptr<Vector> r,
425  ref_ptr<Vector> v,
426  ref_ptr<Vector> fdb,
427  ref_ptr<OpBinary> op,
428  ref_ptr<Descriptor> desc = ref_ptr<Descriptor>(),
429  ref_ptr<ScheduleTask>* task_hnd = nullptr);
430 
447  ref_ptr<Vector> r,
448  ref_ptr<Vector> mask,
449  ref_ptr<Scalar> value,
450  ref_ptr<OpBinary> op_assign,
451  ref_ptr<OpSelect> op_select,
452  ref_ptr<Descriptor> desc = ref_ptr<Descriptor>(),
453  ref_ptr<ScheduleTask>* task_hnd = nullptr);
454 
469  ref_ptr<Vector> r,
470  ref_ptr<Vector> v,
471  ref_ptr<OpUnary> op,
472  ref_ptr<Descriptor> desc = ref_ptr<Descriptor>(),
473  ref_ptr<ScheduleTask>* task_hnd = nullptr);
474 
490  ref_ptr<Scalar> r,
491  ref_ptr<Scalar> s,
492  ref_ptr<Vector> v,
493  ref_ptr<OpBinary> op_reduce,
494  ref_ptr<Descriptor> desc = ref_ptr<Descriptor>(),
495  ref_ptr<ScheduleTask>* task_hnd = nullptr);
496 
516  ref_ptr<Scalar> r,
517  ref_ptr<Vector> v,
518  ref_ptr<Descriptor> desc = ref_ptr<Descriptor>(),
519  ref_ptr<ScheduleTask>* task_hnd = nullptr);
520 
521 }// namespace spla
522 
523 #endif//SPLA_EXEC_HPP
Callback function which can be scheduled in schedule.
Status of library operation execution.
#define SPLA_API
Definition: config.hpp:43
std::uint32_t uint
Library index and size type.
Definition: config.hpp:56
Definition: algorithm.hpp:37
Status exec_m_extract_column(ref_ptr< Vector > r, ref_ptr< Matrix > M, uint index, ref_ptr< OpUnary > op_apply, ref_ptr< Descriptor > desc=ref_ptr< Descriptor >(), ref_ptr< ScheduleTask > *task_hnd=nullptr)
Execute (schedule) matrix column extract.
Definition: exec.cpp:284
Status exec_v_assign_masked(ref_ptr< Vector > r, ref_ptr< Vector > mask, ref_ptr< Scalar > value, ref_ptr< OpBinary > op_assign, ref_ptr< OpSelect > op_select, ref_ptr< Descriptor > desc=ref_ptr< Descriptor >(), ref_ptr< ScheduleTask > *task_hnd=nullptr)
Execute (schedule) masked scalar assignment to a vector.
Definition: exec.cpp:348
Status exec_v_reduce(ref_ptr< Scalar > r, ref_ptr< Scalar > s, ref_ptr< Vector > v, ref_ptr< OpBinary > op_reduce, ref_ptr< Descriptor > desc=ref_ptr< Descriptor >(), ref_ptr< ScheduleTask > *task_hnd=nullptr)
Execute (schedule) vector by structure reduction to a single scalar value.
Definition: exec.cpp:380
Status exec_vxm_masked(ref_ptr< Vector > r, ref_ptr< Vector > mask, ref_ptr< Vector > v, ref_ptr< Matrix > M, ref_ptr< OpBinary > op_multiply, ref_ptr< OpBinary > op_add, ref_ptr< OpSelect > op_select, ref_ptr< Scalar > init, ref_ptr< Descriptor > desc=ref_ptr< Descriptor >(), ref_ptr< ScheduleTask > *task_hnd=nullptr)
Execute (schedule) dense-masked sparse vector by sparse matrix product.
Definition: exec.cpp:150
Status exec_mxmT_masked(ref_ptr< Matrix > R, ref_ptr< Matrix > mask, ref_ptr< Matrix > A, ref_ptr< Matrix > B, ref_ptr< OpBinary > op_multiply, ref_ptr< OpBinary > op_add, ref_ptr< OpSelect > op_select, ref_ptr< Scalar > init, ref_ptr< Descriptor > desc=ref_ptr< Descriptor >(), ref_ptr< ScheduleTask > *task_hnd=nullptr)
Execute (schedule) sparse masked matrix matrix-transposed product.
Definition: exec.cpp:86
Status exec_v_map(ref_ptr< Vector > r, ref_ptr< Vector > v, ref_ptr< OpUnary > op, ref_ptr< Descriptor > desc=ref_ptr< Descriptor >(), ref_ptr< ScheduleTask > *task_hnd=nullptr)
Execute (schedule) by structure map of one vector to another using unary operation.
Definition: exec.cpp:366
Status exec_v_eadd(ref_ptr< Vector > r, ref_ptr< Vector > u, ref_ptr< Vector > v, ref_ptr< OpBinary > op, ref_ptr< Descriptor > desc=ref_ptr< Descriptor >(), ref_ptr< ScheduleTask > *task_hnd=nullptr)
Execute (schedule) element-wise addition by structure of two vectors.
Definition: exec.cpp:300
Status exec_m_eadd(ref_ptr< Matrix > R, ref_ptr< Matrix > A, ref_ptr< Matrix > B, ref_ptr< OpBinary > op, ref_ptr< Descriptor > desc=ref_ptr< Descriptor >(), ref_ptr< ScheduleTask > *task_hnd=nullptr)
Execute (schedule) element-wise addition by structure of two matrices.
Definition: exec.cpp:174
Status exec_m_emult(ref_ptr< Matrix > R, ref_ptr< Matrix > A, ref_ptr< Matrix > B, ref_ptr< OpBinary > op, ref_ptr< Descriptor > desc=ref_ptr< Descriptor >(), ref_ptr< ScheduleTask > *task_hnd=nullptr)
Execute (schedule) element-wise multiplication by structure of two matrices.
Definition: exec.cpp:190
Status exec_kron(ref_ptr< Matrix > R, ref_ptr< Matrix > A, ref_ptr< Matrix > B, ref_ptr< OpBinary > op_multiply, ref_ptr< Descriptor > desc=ref_ptr< Descriptor >(), ref_ptr< ScheduleTask > *task_hnd=nullptr)
Execute (schedule) sparse masked matrix kronecker product.
Definition: exec.cpp:110
Status exec_m_reduce_by_column(ref_ptr< Vector > r, ref_ptr< Matrix > M, ref_ptr< OpBinary > op_reduce, ref_ptr< Scalar > init, ref_ptr< Descriptor > desc=ref_ptr< Descriptor >(), ref_ptr< ScheduleTask > *task_hnd=nullptr)
Execute (schedule) matrix by column reduction to single vector column.
Definition: exec.cpp:222
Status exec_v_eadd_fdb(ref_ptr< Vector > r, ref_ptr< Vector > v, ref_ptr< Vector > fdb, ref_ptr< OpBinary > op, ref_ptr< Descriptor > desc=ref_ptr< Descriptor >(), ref_ptr< ScheduleTask > *task_hnd=nullptr)
Execute (schedule) element-wise addition by structure of two vectors with feedback.
Definition: exec.cpp:332
Status exec_m_reduce_by_row(ref_ptr< Vector > r, ref_ptr< Matrix > M, ref_ptr< OpBinary > op_reduce, ref_ptr< Scalar > init, ref_ptr< Descriptor > desc=ref_ptr< Descriptor >(), ref_ptr< ScheduleTask > *task_hnd=nullptr)
Execute (schedule) matrix by row reduction to single vector column.
Definition: exec.cpp:206
Status exec_m_extract_row(ref_ptr< Vector > r, ref_ptr< Matrix > M, uint index, ref_ptr< OpUnary > op_apply, ref_ptr< Descriptor > desc=ref_ptr< Descriptor >(), ref_ptr< ScheduleTask > *task_hnd=nullptr)
Execute (schedule) matrix row extract.
Definition: exec.cpp:268
Status exec_callback(ScheduleCallback callback, ref_ptr< Descriptor > desc=ref_ptr< Descriptor >(), ref_ptr< ScheduleTask > *task_hnd=nullptr)
Execute (schedule) callback function.
Definition: exec.cpp:56
Status exec_mxv_masked(ref_ptr< Vector > r, ref_ptr< Vector > mask, ref_ptr< Matrix > M, ref_ptr< Vector > v, ref_ptr< OpBinary > op_multiply, ref_ptr< OpBinary > op_add, ref_ptr< OpSelect > op_select, ref_ptr< Scalar > init, ref_ptr< Descriptor > desc=ref_ptr< Descriptor >(), ref_ptr< ScheduleTask > *task_hnd=nullptr)
Execute (schedule) dense-masked sparse matrix by dense vector product.
Definition: exec.cpp:126
Status exec_v_count_mf(ref_ptr< Scalar > r, ref_ptr< Vector > v, ref_ptr< Descriptor > desc=ref_ptr< Descriptor >(), ref_ptr< ScheduleTask > *task_hnd=nullptr)
Execute (schedule) count number of meaningful values by vector structure.
Definition: exec.cpp:396
Status exec_mxm(ref_ptr< Matrix > R, ref_ptr< Matrix > A, ref_ptr< Matrix > B, ref_ptr< OpBinary > op_multiply, ref_ptr< OpBinary > op_add, ref_ptr< Scalar > init, ref_ptr< Descriptor > desc=ref_ptr< Descriptor >(), ref_ptr< ScheduleTask > *task_hnd=nullptr)
Execute (schedule) sparse-matrix sparse-matrix product.
Definition: exec.cpp:66
Status exec_m_transpose(ref_ptr< Matrix > R, ref_ptr< Matrix > M, ref_ptr< OpUnary > op_apply, ref_ptr< Descriptor > desc=ref_ptr< Descriptor >(), ref_ptr< ScheduleTask > *task_hnd=nullptr)
Execute (schedule) matrix transpose operation.
Definition: exec.cpp:254
Status exec_m_reduce(ref_ptr< Scalar > r, ref_ptr< Scalar > s, ref_ptr< Matrix > M, ref_ptr< OpBinary > op_reduce, ref_ptr< Descriptor > desc=ref_ptr< Descriptor >(), ref_ptr< ScheduleTask > *task_hnd=nullptr)
Execute (schedule) matrix by structure reduction to a single scalar value.
Definition: exec.cpp:238
Status exec_v_emult(ref_ptr< Vector > r, ref_ptr< Vector > u, ref_ptr< Vector > v, ref_ptr< OpBinary > op, ref_ptr< Descriptor > desc=ref_ptr< Descriptor >(), ref_ptr< ScheduleTask > *task_hnd=nullptr)
Execute (schedule) element-wise multiplication by structure of two vectors.
Definition: exec.cpp:316