MCPcopy Create free account
hub / github.com/alibaba/MNN / setGlobalExecutorConfig

Method setGlobalExecutorConfig

express/Executor.cpp:28–49  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

26namespace Express {
27
28void Executor::setGlobalExecutorConfig(MNNForwardType type, const BackendConfig& config, int numberThread) {
29 std::lock_guard<std::mutex> _l(mMutex);
30
31 if(type == MNN_FORWARD_AUTO) {
32 ScheduleConfig sConfig;
33 sConfig.type = type;
34 type = Schedule::getAppropriateType(sConfig);
35 }
36 auto rt = _getOrCreateRuntime(type, &config, numberThread);
37 if (rt == nullptr) {
38 type = MNN_FORWARD_CPU;
39 numberThread = 1;
40 rt = _getOrCreateRuntime(type, &config, numberThread);
41 }
42 MNN_ASSERT(nullptr != rt);
43 mAttr->firstType = type;
44 // Cache threadnumber and config
45 mAttr->numThread = numberThread;
46 mAttr->config = config;
47 // Remove sharedContext because it's not used for create backend
48 mAttr->config.sharedContext = nullptr;
49}
50
51int Executor::getCurrentRuntimeStatus(RuntimeStatus statusEnum) {
52 return mRuntimeInfo.first[mAttr->firstType]->onGetRuntimeStatus(statusEnum);

Callers 15

_quantizeModelEMAMethod · 0.80
startOptimizeMethod · 0.80
endOptimizeMethod · 0.80
trainMethod · 0.80
runMethod · 0.80
runMethod · 0.80
trainMethod · 0.80
EnglishBertMethod · 0.80
EnglishBertMethod · 0.80
loadMethod · 0.80
loadMethod · 0.80
loadMethod · 0.80

Calls

no outgoing calls

Tested by 4

runMethod · 0.64
_runmbv1Method · 0.64
runMethod · 0.64
SetupGlobalExecutorMethod · 0.64