InfiniOps
Operator Library for Accelerators
Loading...
Searching...
No Matches
internal_linalg_solve_ex.h
Go to the documentation of this file.
1#ifndef INFINI_OPS_BASE_INTERNAL_LINALG_SOLVE_EX_H_
2#define INFINI_OPS_BASE_INTERNAL_LINALG_SOLVE_EX_H_
3
4#include "operator.h"
5
7
8class SolveEx : public Operator<SolveEx> {
9 public:
10 SolveEx(const Tensor A, const Tensor B, const bool left,
11 const bool check_errors, Tensor result, Tensor LU, Tensor pivots,
12 Tensor info)
13 : A_shape_{A.shape()},
14 A_strides_{A.strides()},
15 A_type_{A.dtype()},
16 B_shape_{B.shape()},
17 B_strides_{B.strides()},
18 B_type_{B.dtype()},
19 result_shape_{result.shape()},
20 result_strides_{result.strides()},
21 result_type_{result.dtype()},
22 LU_shape_{LU.shape()},
23 LU_strides_{LU.strides()},
24 LU_type_{LU.dtype()},
25 pivots_shape_{pivots.shape()},
26 pivots_strides_{pivots.strides()},
27 pivots_type_{pivots.dtype()},
28 info_shape_{info.shape()},
29 info_strides_{info.strides()},
30 info_type_{info.dtype()},
31 left_{left},
32 check_errors_{check_errors},
33 device_index_{result.device().index()} {}
34
35 virtual void operator()(const Tensor A, const Tensor B, const bool left,
36 const bool check_errors, Tensor result, Tensor LU,
37 Tensor pivots, Tensor info) const = 0;
38
39 protected:
40 Tensor::Shape A_shape_;
41
42 Tensor::Strides A_strides_;
43
44 DataType A_type_;
45
46 Tensor::Shape B_shape_;
47
48 Tensor::Strides B_strides_;
49
50 DataType B_type_;
51
52 Tensor::Shape result_shape_;
53
54 Tensor::Strides result_strides_;
55
56 DataType result_type_;
57
58 Tensor::Shape LU_shape_;
59
60 Tensor::Strides LU_strides_;
61
62 DataType LU_type_;
63
64 Tensor::Shape pivots_shape_;
65
66 Tensor::Strides pivots_strides_;
67
68 DataType pivots_type_;
69
70 Tensor::Shape info_shape_;
71
72 Tensor::Strides info_strides_;
73
74 DataType info_type_;
75
76 bool left_{};
77
79
81};
82
83} // namespace infini::ops::internal::linalg
84
85#endif
Definition generated/include/operator.h:282
Definition internal_linalg_solve_ex.h:8
bool check_errors_
Definition internal_linalg_solve_ex.h:78
Tensor::Strides B_strides_
Definition internal_linalg_solve_ex.h:48
DataType B_type_
Definition internal_linalg_solve_ex.h:50
Tensor::Shape A_shape_
Definition internal_linalg_solve_ex.h:40
Tensor::Shape result_shape_
Definition internal_linalg_solve_ex.h:52
Tensor::Shape pivots_shape_
Definition internal_linalg_solve_ex.h:64
DataType info_type_
Definition internal_linalg_solve_ex.h:74
DataType result_type_
Definition internal_linalg_solve_ex.h:56
Tensor::Strides pivots_strides_
Definition internal_linalg_solve_ex.h:66
Tensor::Strides LU_strides_
Definition internal_linalg_solve_ex.h:60
virtual void operator()(const Tensor A, const Tensor B, const bool left, const bool check_errors, Tensor result, Tensor LU, Tensor pivots, Tensor info) const =0
Tensor::Shape LU_shape_
Definition internal_linalg_solve_ex.h:58
Tensor::Strides result_strides_
Definition internal_linalg_solve_ex.h:54
bool left_
Definition internal_linalg_solve_ex.h:76
DataType A_type_
Definition internal_linalg_solve_ex.h:44
Tensor::Shape B_shape_
Definition internal_linalg_solve_ex.h:46
Tensor::Shape info_shape_
Definition internal_linalg_solve_ex.h:70
Tensor::Strides A_strides_
Definition internal_linalg_solve_ex.h:42
DataType pivots_type_
Definition internal_linalg_solve_ex.h:68
int device_index_
Definition internal_linalg_solve_ex.h:80
Tensor::Strides info_strides_
Definition internal_linalg_solve_ex.h:72
DataType LU_type_
Definition internal_linalg_solve_ex.h:62
SolveEx(const Tensor A, const Tensor B, const bool left, const bool check_errors, Tensor result, Tensor LU, Tensor pivots, Tensor info)
Definition internal_linalg_solve_ex.h:10
Definition internal_linalg_det.h:6
infini::rt::TensorView Tensor
Definition tensor.h:8