// // LayerNormExecution.hpp // MNN // // Created by MNN on 2019/01/31. // Copyright © 2018, Alibaba Group Holding Limited // #ifndef LayerNormExecution_hpp #define LayerNormExecution_hpp #include "core/Execution.hpp" #include "MNNCUDAFunction.cuh" #include #include "backend/cuda/core/CUDABackend.hpp" namespace MNN { namespace CUDA { class LayerNormExecution : public Execution { public: LayerNormExecution(const LayerNorm* layer_norm_param, Backend *backend); virtual ~LayerNormExecution(); virtual ErrorCode onResize(const std::vector &inputs, const std::vector &outputs) override; virtual ErrorCode onExecute(const std::vector &inputs, const std::vector &outputs) override; private: CUDARuntime *mRuntime; void *mDeviceGamma = nullptr; void *mDeviceBeta = nullptr; int mAxises = 0; int mInside = 1; int mOutside = 1; float mEps = 0.001; int mGroup = 1; bool RMSNorm = false; std::unique_ptr mGammaTensor; std::unique_ptr mBetaTensor; std::shared_ptr LayerNormTensor; std::shared_ptr biasTensor; }; } // namespace CUDA } // namespace MNN #endif /* LayerNormExecution_hpp */