MCPcopy Create free account
hub / github.com/Tencent/TNN / GetNetworkConfig

Function GetNetworkConfig

test/test.cc:307–334  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

305 }
306
307 NetworkConfig GetNetworkConfig() {
308 NetworkConfig config;
309 // Precision : AUTO for float computing.
310 config.precision = ConvertPrecision(FLAGS_pr);
311
312 config.enable_tune_kernel = FLAGS_et;
313#if defined(__ANDROID__)
314 config.cache_path = "/data/local/tmp/";
315#else
316 config.cache_path = "";
317#endif
318
319 // Device Type: ARM, OPENECL, ...
320 config.device_type = ConvertDeviceType(FLAGS_dt);
321
322 // use model type instead, may change later for same model type with
323 // different network type
324 if (config.device_type == DEVICE_CUDA) {
325 config.network_type = NETWORK_TYPE_TENSORRT;
326 } else {
327 config.network_type = ConvertNetworkType(FLAGS_nt);
328 }
329
330 if (FLAGS_lp.length() > 0) {
331 config.library_path = {FLAGS_lp};
332 }
333 return config;
334 }
335
336 bool CheckResult(std::string desc, Status result) {
337 if (result != 0) {

Callers 1

RunFunction · 0.85

Calls 3

ConvertPrecisionFunction · 0.85
ConvertNetworkTypeFunction · 0.85
ConvertDeviceTypeFunction · 0.70

Tested by

no test coverage detected