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

Function iosBenchAll

benchmark/benchmark.cpp:368–384  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

366
367#if TARGET_OS_IPHONE
368void iosBenchAll(const char* modelPath) {
369 std::cout << "MNN benchmark" << std::endl;
370 int loop = 20;
371 int warmup = 10;
372 MNNForwardType forward = MNN_FORWARD_CPU;
373 forward = MNN_FORWARD_NN;
374 int numberThread = 4;
375 int precision = 2;
376 std::cout << "Forward type: **" << forwardType(forward) << "** thread=" << numberThread << "** precision=" <<precision << std::endl;
377 std::vector<Model> models = findModelFiles(modelPath);
378 std::cout << "--------> Benchmarking... loop = " << loop << ", warmup = " << warmup << std::endl;
379
380 for (auto& m : models) {
381 std::vector<float> costs = doBench(m, loop, warmup, forward, false, numberThread, precision);
382 displayStats(m.name, costs);
383 }
384}
385#else
386int main(int argc, const char* argv[]) {
387 std::cout << "MNN benchmark" << std::endl;

Callers

nothing calls this directly

Calls 4

findModelFilesFunction · 0.85
doBenchFunction · 0.85
forwardTypeFunction · 0.70
displayStatsFunction · 0.70

Tested by

no test coverage detected