SMAUG
Simulating Machine Learning Applications on gem5-Aladdin
smv_batch_norm_tiling.h
1 #ifndef _OPERATORS_SMV_SMV_BATCH_NORM_TILING_H_
2 #define _OPERATORS_SMV_SMV_BATCH_NORM_TILING_H_
3 
4 #include "smaug/core/backend.h"
5 #include "smaug/core/tensor.h"
6 #include "smaug/operators/smv/smv_tiling_common.h"
7 #include "smaug/operators/smv/smv_tiling_base.h"
8 
9 namespace smaug {
10 
11 class SmvBatchNormOp;
12 
13 namespace smv {
14 namespace bn {
15 
20  public:
26  static std::array<TiledTensor, 3> doTiling(SmvBatchNormOp* op);
27 
50  Tensor* weights,
51  Tensor* outputs);
52 
53  protected:
60  static std::array<TilingDims, 2> determineBestTilingDims(Tensor* inputs,
61  Tensor* weights,
62  int maxTileSize);
63  static void enumPostFCTilingConfigs(TensorShape inputsShape,
64  TensorShape weightsShape,
65  int maxTileSize,
66  std::array<TilingDims, 2> strategies,
67  std::list<TilingConfig>& fullConfigs);
68  static void enumPostConvTilingConfigs(TensorShape inputsShape,
69  TensorShape weightsShape,
70  int maxTileSize,
71  std::array<TilingDims, 2> strategies,
72  std::list<TilingConfig>& fullConfigs);
73 };
74 
75 } // namespace bn
76 } // namespace smv
77 } // namespace smaug
78 
79 #endif
smaug::Tensor
Tensor represents a single multi-dimensional array of data.
Definition: tensor.h:344
smaug::SmvBatchNormOp
SMV backend implementation of batch normalization.
Definition: smv_batch_norm_op.h:27
smaug::TensorShape
TensorShape describes the shape of a Tensor.
Definition: tensor.h:35
smaug::smv::TilingOptimizerBase
Definition: smv_tiling_base.h:11
smaug::smv::TilingConfig
A TilingConfig describes tiling strategies and optimal tile sizes for inputs, weights,...
Definition: smv_tiling_common.h:29
smaug::smv::bn::TilingOptimizer::doTiling
static std::array< TiledTensor, 3 > doTiling(SmvBatchNormOp *op)
Runs the tiling optimizer on the given batch norm op.
Definition: smv_batch_norm_tiling.cpp:260
smaug
The smaug namespace is the parent namespace of all C++ code in SMAUG.
Definition: backend.cpp:38
smaug::smv::bn::TilingOptimizer::computeBasicTileShapes
static TilingConfig computeBasicTileShapes(Tensor *inputs, Tensor *weights, Tensor *outputs)
Determine the best basic tiling shape for this batch norm layer.
Definition: smv_batch_norm_tiling.cpp:207
smaug::smv::bn::TilingOptimizer::determineBestTilingDims
static std::array< TilingDims, 2 > determineBestTilingDims(Tensor *inputs, Tensor *weights, int maxTileSize)
Determine the best tiling dimensions for running batch norm on SMV.
Definition: smv_batch_norm_tiling.cpp:13
smaug::smv::bn::TilingOptimizer
Tiling optimizer for SMV batch norm kernel.
Definition: smv_batch_norm_tiling.h:19