MCPcopy Create free account
hub / github.com/XiaoMi/mace / ParseDeviceType

Function ParseDeviceType

examples/android/macelibrary/src/main/cpp/image_classify.cc:57–67  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

55};
56
57mace::RuntimeType ParseDeviceType(const std::string &device) {
58 if (device.compare("CPU") == 0) {
59 return mace::RuntimeType::RT_CPU;
60 } else if (device.compare("GPU") == 0) {
61 return mace::RuntimeType::RT_OPENCL;
62 } else if (device.compare("HEXAGON") == 0) {
63 return mace::RuntimeType::RT_HEXAGON;
64 } else {
65 return mace::RuntimeType::RT_CPU;
66 }
67}
68
69MaceContext& GetMaceContext() {
70 // TODO(yejianwu): In multi-dlopen process, this step may cause memory leak.

Calls 1

compareMethod · 0.80

Tested by

no test coverage detected