#ifndef LCF_SUM_H_
#define LCF_SUM_H_
#include "tensorOperate.h"

class SumLayer : public TensorOperate
{
    public:
        SumLayer();
        SumLayer(int ifType, int iID, int iMaxSeqNum, DevicesBatchDisptach *iDevicesBatchDisptach, const char *sumStr);
        virtual ~SumLayer();
        void SetLayerConfig(int ifType, int iID, int iMaxSeqNum, DevicesBatchDisptach *iDevicesBatchDisptach, const char *sumStr);
        void ComputeAndCreateOutYInDTensorInfo();
        void CreateParaAndInstance();
        void CompuateOutY(int devID, int seqNum);
        void CompuateOutD(int devID, int seqNum);

        void ComputerYMemRealease(int devID);
        void ComputerDMemRealease(int devID);
    private:
        void SetChildLayerMomeryPointInitStatus();
        DATA_SUM_TYPE GetSumType();
        DATA_SUM_TYPE GetSumTypeByStr(const char *str);
        void CompuateOutY_CHW_SUM(int devID, int seqNum);
        void CompuateOutY_C_SUM(int devID, int seqNum);
        void CompuateOutY_HW_SUM(int devID, int seqNum);
        void CompuateOutD_CHW_SUM(int devID, int seqNum);
        void CompuateOutD_C_SUM(int devID, int seqNum);
        void CompuateOutD_HW_SUM(int devID, int seqNum);
        
        int inChannels, inHeight, inWidth;
        int outChannels, outHeight, outWidth;
        DATA_SUM_TYPE mSumType;
};

#endif
