MNN/source/core/Command.hpp

40 lines
889 B
C++
Raw Normal View History

2020-11-05 16:41:56 +08:00
//
// Command.hpp
// MNN
//
// Created by MNN on b'2020/07/28'.
// Copyright © 2018, Alibaba Group Holding Limited
//
#ifndef Command_hpp
#define Command_hpp
#include <MNN/Tensor.hpp>
#include "AutoStorage.h"
2021-02-07 10:45:07 +08:00
#include <string>
2020-11-05 16:41:56 +08:00
#include <memory>
namespace MNN {
struct Op;
class Execution;
class OperatorInfo;
2024-04-19 11:58:21 +08:00
struct Command {
2020-11-05 16:41:56 +08:00
const Op* op;
2022-12-30 15:18:58 +08:00
std::vector<Tensor*> workInputs;
2023-04-18 18:54:46 +08:00
std::vector<Tensor*> workOutputs;
2020-11-05 16:41:56 +08:00
std::vector<Tensor*> inputs;
std::vector<Tensor*> outputs;
std::shared_ptr<BufferStorage> buffer;
std::shared_ptr<Execution> execution;
std::shared_ptr<OperatorInfo> info;
2023-07-18 09:36:26 +08:00
#ifdef MNN_BUILD_CODEGEN
bool canVectorize = false;
#endif
2024-04-19 11:58:21 +08:00
int group = 0;
2020-11-05 16:41:56 +08:00
};
struct CommandBuffer {
2024-04-19 11:58:21 +08:00
std::vector<std::shared_ptr<Command>> command;
2020-11-05 16:41:56 +08:00
std::vector<std::shared_ptr<Tensor>> extras;
2022-12-30 15:18:58 +08:00
bool hasWrap = false;
2020-11-05 16:41:56 +08:00
};
}; // namespace MNN
#endif