MNN/source/backend/cuda/execution/SoftmaxExecution.hpp

39 lines
946 B
C++
Raw Normal View History

2020-12-15 14:12:35 +08:00
//
// SoftmaxExecution.hpp
// MNN
//
// Created by MNN on 2019/01/31.
// Copyright © 2018, Alibaba Group Holding Limited
//
#ifndef SoftmaxExecution_hpp
#define SoftmaxExecution_hpp
#include <vector>
2022-02-18 11:30:27 +08:00
#include "ReductionTemplate.cuh"
2023-05-18 19:11:50 +08:00
#include "MNNCUDAFunction.cuh"
2020-12-15 14:12:35 +08:00
#include "backend/cuda/core/CUDABackend.hpp"
2023-02-15 10:30:27 +08:00
#include <float.h>
2020-12-15 14:12:35 +08:00
namespace MNN {
namespace CUDA {
class SoftmaxExecution : public Execution {
public:
SoftmaxExecution(int axis, Backend *backend);
virtual ~SoftmaxExecution();
virtual ErrorCode onResize(const std::vector<Tensor *> &inputs, const std::vector<Tensor *> &outputs) override;
virtual ErrorCode onExecute(const std::vector<Tensor *> &inputs, const std::vector<Tensor *> &outputs) override;
private:
int mAxis;
2022-02-18 11:30:27 +08:00
Tensor mStorage;
bool mNeedUnpackC4;
ReduceParam mCpuParam;
std::pair<void*, int> mParam;
2020-12-15 14:12:35 +08:00
};
} // namespace CUDA
} // namespace MNN
#endif /* SoftmaxExecution_hpp */