MNN/source/backend/cpu/CPUTensorConvert.hpp

32 lines
970 B
C++
Raw Normal View History

2019-04-17 10:49:11 +08:00
//
// CPUTensorConvert.hpp
// MNN
//
// Created by MNN on 2018/08/04.
// Copyright © 2018, Alibaba Group Holding Limited
//
#ifndef CPUTensorConvert_hpp
#define CPUTensorConvert_hpp
2019-12-27 22:16:57 +08:00
#include "core/Execution.hpp"
2019-04-17 10:49:11 +08:00
#include "Tensor_generated.h"
namespace MNN {
class CPUTensorConverter : public Execution {
public:
2019-12-27 22:16:57 +08:00
CPUTensorConverter(Backend* b) : Execution(b) {
// Do nothing
2019-04-17 10:49:11 +08:00
}
virtual ~CPUTensorConverter() = default;
2021-04-08 15:34:23 +08:00
static std::tuple<int, int, int> splitDimensions(const halide_buffer_t& ib, MNN_DATA_FORMAT source);
2019-04-17 10:49:11 +08:00
static ErrorCode convert(const Tensor* input, const Tensor* output);
static ErrorCode convert(const void* inputRaw, void* outputRaw, MNN_DATA_FORMAT inputFormat, MNN_DATA_FORMAT outputFormat, int batch, int area, int channel, int bytes);
2019-04-17 10:49:11 +08:00
virtual ErrorCode onExecute(const std::vector<Tensor*>& inputs, const std::vector<Tensor*>& outputs) override;
};
} // namespace MNN
#endif /* CPUTensorConvert_hpp */