SMAUG
Simulating Machine Learning Applications on gem5-Aladdin
smv_convolution_tiling.h
1 #ifndef _OPERATORS_SMV_SMV_CONVOLUTION_TILING_H_
2 #define _OPERATORS_SMV_SMV_CONVOLUTION_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 SmvConvolutionOp;
12 
13 namespace smv {
14 namespace conv {
15 
20  public:
21  static std::array<TiledTensor, 3> doTiling(SmvConvolutionOp* op);
22 
48 
56  SmvConvolutionOp* op,
57  const TiledTensor& inputTiledTensor,
58  const TiledTensor& weightsTiledTensor,
59  const TensorShape& maxOutputTileSize,
60  Tensor* outputTensor,
61  bool copyData = false);
62 
63  protected:
74  static std::array<TilingDims, 3> determineBestTilingDims(Tensor* inputs,
75  Tensor* weights,
76  Tensor* outputs,
77  int maxTileSize);
78 };
79 
80 } // namespace conv
81 } // namespace smv
82 } // namespace smaug
83 
84 #endif
smaug::Tensor
Tensor represents a single multi-dimensional array of data.
Definition: tensor.h:344
smaug::smv::conv::TilingOptimizer::computeBasicTileShapes
static TilingConfig computeBasicTileShapes(SmvConvolutionOp *op)
Determine the best basic tiling shape for this convolution layer.
Definition: smv_convolution_tiling.cpp:57
smaug::smv::conv::TilingOptimizer
Tiling optimizer for SMV convolution kernel.
Definition: smv_convolution_tiling.h:19
smaug::TiledTensor
A multidimensional container of Tensors.
Definition: tensor.h:552
smaug::TensorShape
TensorShape describes the shape of a Tensor.
Definition: tensor.h:35
smaug::smv::TilingOptimizerBase
Definition: smv_tiling_base.h:11
smaug::smv::conv::TilingOptimizer::generateRowwiseOutputTiledTensor
static TiledTensor generateRowwiseOutputTiledTensor(SmvConvolutionOp *op, const TiledTensor &inputTiledTensor, const TiledTensor &weightsTiledTensor, const TensorShape &maxOutputTileSize, Tensor *outputTensor, bool copyData=false)
A specialized output tiling function when the output is tiled rowwise.
Definition: smv_convolution_tiling.cpp:249
smaug::smv::TilingConfig
A TilingConfig describes tiling strategies and optimal tile sizes for inputs, weights,...
Definition: smv_tiling_common.h:29
smaug
The smaug namespace is the parent namespace of all C++ code in SMAUG.
Definition: backend.cpp:38
smaug::smv::conv::TilingOptimizer::determineBestTilingDims
static std::array< TilingDims, 3 > determineBestTilingDims(Tensor *inputs, Tensor *weights, Tensor *outputs, int maxTileSize)
Determine the best tiling dimensions for running convolution on SMV.
Definition: smv_convolution_tiling.cpp:13
smaug::SmvConvolutionOp
SMV backend implementation of convolution.
Definition: smv_convolution_op.h:27