2022-01-04 10:50:40 +08:00
|
|
|
#ifndef RuntimeAttr_hpp
|
|
|
|
#define RuntimeAttr_hpp
|
|
|
|
#include "core/Session.hpp"
|
|
|
|
namespace MNN{
|
|
|
|
namespace Express {
|
2022-06-24 18:30:05 +08:00
|
|
|
struct Cache {
|
|
|
|
AutoStorage<uint8_t> modelBuffer;
|
|
|
|
AutoStorage<uint8_t> cacheBuffer;
|
|
|
|
size_t cacheOffset = 0;
|
|
|
|
std::string cacheFile;
|
|
|
|
size_t lastCacheSize = 0;
|
|
|
|
};
|
2022-01-04 10:50:40 +08:00
|
|
|
struct RuntimeAttr {
|
|
|
|
Session::ModeGroup modes;
|
2022-06-24 18:30:05 +08:00
|
|
|
RuntimeInfo mRuntime;
|
|
|
|
std::shared_ptr<Runtime> mInfo;
|
|
|
|
std::shared_ptr<Cache> mCache;
|
|
|
|
BackendConfig mConfig;
|
|
|
|
bool mUserConfig;
|
2022-07-22 09:59:30 +08:00
|
|
|
int mNumberThread;
|
|
|
|
// Use for static module to compute flops
|
|
|
|
float mFlops;
|
2022-12-30 15:18:58 +08:00
|
|
|
std::string mExternalFile;
|
|
|
|
};
|
|
|
|
struct ExecutorAttr {
|
|
|
|
std::shared_ptr<Backend> constantBackend;
|
|
|
|
std::pair<MNNForwardType, int> firstType;
|
2024-04-19 11:58:21 +08:00
|
|
|
std::string externalFile;
|
2022-01-04 10:50:40 +08:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|