SMAUG
Simulating Machine Learning Applications on gem5-Aladdin
|
1 #include "smaug/core/backend.h"
2 #include "smaug/operators/batch_norm_op.h"
3 #include "smaug/operators/concat_op.h"
4 #include "smaug/operators/control_flow_ops.h"
5 #include "smaug/operators/convolution_op.h"
6 #include "smaug/operators/data_op.h"
7 #include "smaug/operators/depthwise_convolution_op.h"
8 #include "smaug/operators/eltwise_add_op.h"
9 #include "smaug/operators/eltwise_mul_op.h"
10 #include "smaug/operators/elu_op.h"
11 #include "smaug/operators/greater_op.h"
12 #include "smaug/operators/inner_product_op.h"
13 #include "smaug/operators/less_op.h"
14 #include "smaug/operators/padding_op.h"
15 #include "smaug/operators/pooling_op.h"
16 #include "smaug/operators/relu_op.h"
17 #include "smaug/operators/reorder_op.h"
18 #include "smaug/operators/repeat_op.h"
19 #include "smaug/operators/reshape_op.h"
20 #include "smaug/operators/sigmoid_op.h"
21 #include "smaug/operators/smv/smv_batch_norm_op.h"
22 #include "smaug/operators/smv/smv_convolution_op.h"
23 #include "smaug/operators/smv/smv_eltwise_add_op.h"
24 #include "smaug/operators/smv/smv_eltwise_mul_op.h"
25 #include "smaug/operators/smv/smv_elu_op.h"
26 #include "smaug/operators/smv/smv_greater_op.h"
27 #include "smaug/operators/smv/smv_inner_product_op.h"
28 #include "smaug/operators/smv/smv_less_op.h"
29 #include "smaug/operators/smv/smv_pooling_op.h"
30 #include "smaug/operators/smv/smv_relu_op.h"
31 #include "smaug/operators/smv/smv_sigmoid_op.h"
32 #include "smaug/operators/smv/smv_softmax_op.h"
33 #include "smaug/operators/smv/smv_tanh_op.h"
34 #include "smaug/operators/softmax_op.h"
35 #include "smaug/operators/split_op.h"
36 #include "smaug/operators/tanh_op.h"
40 #define DEF_CREATE_OP(OpType, Backend) \
41 OpType<Backend>* Backend::create##OpType( \
42 const std::string& name, Workspace* workspace) { \
43 return new OpType<Backend>(name, workspace); \
46 #define DEF_CREATE_SMV_OP(OpType) \
47 Smv##OpType* SmvBackend::create##OpType( \
48 const std::string& name, Workspace* workspace) { \
49 return new Smv##OpType(name, workspace); \
52 const std::string ReferenceBackend::Name =
"Reference";
53 const std::string SmvBackend::Name =
"SMV";
91 DEF_CREATE_SMV_OP(
EluOp)
117 const unsigned kConvolutionHw = 0x0001;
118 const unsigned kInnerProductHw = 0x0002;
119 const unsigned kEltwiseOpHw = 0x0003;
120 const unsigned kBatchNormHw = 0x0004;
121 const unsigned kPoolingHw = 0x0005;
134 const unsigned kConvolutionHw = 0x0003;
135 const unsigned kInnerProductHw = 0x0003;
136 const unsigned kEltwiseOpHw = 0x0003;
137 const unsigned kBatchNormHw = 0x0003;
138 const unsigned kPoolingHw = 0x0003;
141 const unsigned kSystolicArrayHw = 0x0004;
Replicates a Tensor's data among all dimensions.
Concatenates N Tensors along a specified axis.
Adds two Tensors elementwise.
SmvBackend implements a set of models of optimized DL kernels that were taped out on a machine learni...
Implements an elementwise less-than-or-equal-to operator.
Implements the sigmoid operator, defined as 1/(1 + exp(-input)).
Implements the softmax operator.
Implements the scaled exponential linear unit function.
Implements the hard tanh operator, which bounds the min and max value of the tanh operator.
Implements the inner product operator.
Implements the tanh operator.
Implements the split operator, which divides a Tensor into N output Tensors along a specified dimensi...
Conditionally forwards an input to one of two outputs.
Implements an elementwise less-than operator.
Implements the depthwise convolution operator.
ReferenceBackend provides reference implementations of all operators supported by SMAUG.
Implements the batch normalization layer.
Implements an elementwise greater than operator.
Implements the max-pooling operator.
Implements the exponential linear unit function.
Implements the rectified linear unit operator: max(slope * x, 0).
The smaug namespace is the parent namespace of all C++ code in SMAUG.
Implements the arithmetic-average-pooling operator.
Forwards the first live input to its output.
Exposes a Tensor as its only output.
Multiplies two Tensors elementwise.
Pad a given tensor in any number of dimensions with arbitrary size.
The base class for all 4D spatial convolution operators.
Implements an elementwise greater than or equal to operator.
Flattens each batch of a Tensor.
Implements a Tensor reordering operation to convert between different DataLayouts.
Changes the Tensor's shape while retaining the number of elements.