SMAUG
Simulating Machine Learning Applications on gem5-Aladdin
smv_tanh_op.h
1 #ifndef _OPERATORS_SMV_SMV_TANH_OP_H_
2 #define _OPERATORS_SMV_SMV_TANH_OP_H_
3 
4 #include "smaug/core/backend.h"
6 #include "smaug/operators/tanh_op.h"
7 #include "smaug/operators/smv/smv_unary_op_common.h"
8 
9 namespace smaug {
10 
12 class SmvTanhOp : public TanhOp<SmvBackend> {
13  public:
15  void tile() override { tiledTensors = smv::unary::doTiling(this, false); }
16  void run() override { smv::unary::run(this, tiledTensors); }
17 
18  protected:
19  std::array<TiledTensor, 2> tiledTensors;
20 };
21 
23 class SmvHardTanhOp : public HardTanhOp<SmvBackend> {
24  public:
26  void tile() override { tiledTensors = smv::unary::doTiling(this, false); }
27  void run() override { smv::unary::run(this, tiledTensors); }
28 
29  protected:
30  std::array<TiledTensor, 2> tiledTensors;
31 };
32 
33 } // namespace smaug
34 
35 #endif
36 
smaug::SmvTanhOp
Tanh operator on SMV.
Definition: smv_tanh_op.h:12
smaug::HardTanhOp
Implements the hard tanh operator, which bounds the min and max value of the tanh operator.
Definition: backend.h:60
smaug::TanhOp
Implements the tanh operator.
Definition: backend.h:59
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::SmvHardTanhOp
Hard tanh operator on SMV.
Definition: smv_tanh_op.h:23