MNN/express/RuntimeAttr.hpp

41 lines
929 B
C++
Raw Normal View History

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 {
2025-01-22 14:47:50 +08:00
struct Immutable {
Session::ModeGroup modes;
BackendConfig mConfig;
bool mUserConfig;
int mNumberThread;
std::string mExternalFile;
};
std::shared_ptr<Immutable> mContent;
2022-06-24 18:30:05 +08:00
RuntimeInfo mRuntime;
std::shared_ptr<Runtime> mInfo;
std::shared_ptr<Cache> mCache;
2022-07-22 09:59:30 +08:00
// Use for static module to compute flops
float mFlops;
2025-01-22 14:47:50 +08:00
mutable int mResizeStatus = 0;
2022-12-30 15:18:58 +08:00
};
struct ExecutorAttr {
std::shared_ptr<Backend> constantBackend;
2024-07-22 19:51:53 +08:00
MNNForwardType firstType;
2024-11-18 14:37:45 +08:00
int numThread = 1;
BackendConfig config;
2024-04-19 11:58:21 +08:00
std::string externalFile;
2022-01-04 10:50:40 +08:00
};
};
};
#endif