InfiniOps
Operator Library for Accelerators
Loading...
Searching...
No Matches
hspmm.h
Go to the documentation of this file.
1#ifndef INFINI_OPS_BASE_HSPMM_H_
2#define INFINI_OPS_BASE_HSPMM_H_
3
4#include "operator.h"
5
6namespace infini::ops {
7
8class Hspmm : public Operator<Hspmm> {
9 public:
10 Hspmm(const Tensor mat1, const Tensor mat2, Tensor out)
11 : mat1_shape_{mat1.shape()},
12 mat1_strides_{mat1.strides()},
13 mat1_type_{mat1.dtype()},
14 mat2_shape_{mat2.shape()},
15 mat2_strides_{mat2.strides()},
16 mat2_type_{mat2.dtype()},
17 out_shape_{out.shape()},
18 out_strides_{out.strides()},
19 out_type_{out.dtype()},
20 device_index_{out.device().index()} {}
21
22 virtual void operator()(const Tensor mat1, const Tensor mat2,
23 Tensor out) const = 0;
24
25 protected:
26 Tensor::Shape mat1_shape_;
27
28 Tensor::Strides mat1_strides_;
29
30 DataType mat1_type_;
31
32 Tensor::Shape mat2_shape_;
33
34 Tensor::Strides mat2_strides_;
35
36 DataType mat2_type_;
37
38 Tensor::Shape out_shape_;
39
40 Tensor::Strides out_strides_;
41
42 DataType out_type_;
43
45};
46
47} // namespace infini::ops
48
49#endif
Definition hspmm.h:8
Tensor::Shape mat1_shape_
Definition hspmm.h:26
DataType mat2_type_
Definition hspmm.h:36
virtual void operator()(const Tensor mat1, const Tensor mat2, Tensor out) const =0
DataType out_type_
Definition hspmm.h:42
Tensor::Strides out_strides_
Definition hspmm.h:40
Tensor::Shape out_shape_
Definition hspmm.h:38
int device_index_
Definition hspmm.h:44
Hspmm(const Tensor mat1, const Tensor mat2, Tensor out)
Definition hspmm.h:10
Tensor::Shape mat2_shape_
Definition hspmm.h:32
Tensor::Strides mat2_strides_
Definition hspmm.h:34
DataType mat1_type_
Definition hspmm.h:30
Tensor::Strides mat1_strides_
Definition hspmm.h:28
Definition generated/include/operator.h:282
Definition generated/include/operator.h:28
infini::rt::TensorView Tensor
Definition tensor.h:8