SMAUG
Simulating Machine Learning Applications on gem5-Aladdin
smv_batch_norm_op.h
1 #ifndef _OPERATORS_SMV_SMV_BATCH_NORM_OP_H_
2 #define _OPERATORS_SMV_SMV_BATCH_NORM_OP_H_
3 
4 #include "smaug/core/backend.h"
6 #include "smaug/operators/batch_norm_op.h"
7 
8 namespace smaug {
9 
10 namespace smv {
11 
13 namespace bn {
14 
15 extern const int kVectorSize;
16 
17 class TilingOptimizer;
18 
19 } // namespace bn
20 } // namespace smv
21 
27 class SmvBatchNormOp : public BatchNormOp<SmvBackend> {
28  public:
30  void tile() override;
31  void run() override;
32 
33  protected:
35  void runNA(TiledTensor& inputs, TiledTensor& weights, TiledTensor& outputs);
36 
38  void runNHWC(TiledTensor& inputs,
39  TiledTensor& weights,
40  TiledTensor& outputs);
41 
42  std::array<TiledTensor, 3> tiledTensors;
43 };
44 
45 } // namespace smaug
46 
47 #endif
smaug::TiledTensor
A multidimensional container of Tensors.
Definition: tensor.h:552
smaug::SmvBatchNormOp
SMV backend implementation of batch normalization.
Definition: smv_batch_norm_op.h:27
smaug::SmvBatchNormOp::runNHWC
void runNHWC(TiledTensor &inputs, TiledTensor &weights, TiledTensor &outputs)
Post-convolution tile dispatcher.
Definition: smv_batch_norm_op.cpp:101
smaug::BatchNormOp
Implements the batch normalization layer.
Definition: backend.h:46
smaug
The smaug namespace is the parent namespace of all C++ code in SMAUG.
Definition: backend.cpp:38
common.h
Utilities for writing and invoking Aladdin kernels from Operators.
smaug::SmvBatchNormOp::runNA
void runNA(TiledTensor &inputs, TiledTensor &weights, TiledTensor &outputs)
Post-FC tile dispatcher.
Definition: smv_batch_norm_op.cpp:22