MCPcopy Create free account
hub / github.com/ROCm/AMDMIGraphX / load

Method load

src/driver/main.cpp:359–426  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

357 }
358
359 program load()
360 {
361 program p;
362 if(is_test)
363 {
364 p = test_gemm();
365 }
366 else
367 {
368 if(file_type.empty())
369 {
370 file_type = get_file_type(file);
371 }
372 std::cout << "Reading: " << file << std::endl;
373 if(file_type == "onnx")
374 {
375 p = parse_onnx(file, get_onnx_options());
376 }
377 else if(file_type == "tf")
378 {
379 p = parse_tf(file, get_tf_options());
380 }
381 else if(file_type == "json")
382 {
383 file_options options;
384 options.format = "json";
385 p = migraphx::load(file, options);
386 }
387#ifdef MIGRAPHX_ENABLE_PYTHON
388 else if(file_type == "py")
389 {
390 p = migraphx::load_py(file);
391 }
392#endif
393 else if(file_type == "migraphx")
394 {
395 p = migraphx::load(file);
396 }
397 }
398 if(trim > 0)
399 {
400 trim_module(*p.get_main_module(), trim, trim_size);
401 }
402 // Remove unused variable when exporting to cpp
403 if(output_type == "cpp")
404 migraphx::run_passes(*p.get_main_module(), {migraphx::dead_code_elimination{}});
405 if(optimize)
406 {
407 migraphx::run_passes(*p.get_main_module(),
408 {
409 migraphx::eliminate_identity{},
410 migraphx::dead_code_elimination{},
411 migraphx::simplify_algebra{},
412 migraphx::dead_code_elimination{},
413 migraphx::simplify_reshapes{},
414 migraphx::dead_code_elimination{},
415 migraphx::propagate_constant{},
416 migraphx::dead_code_elimination{},

Callers 4

compileMethod · 0.45
runMethod · 0.45
runMethod · 0.45
runMethod · 0.45

Calls 11

load_pyFunction · 0.85
trim_moduleFunction · 0.85
run_passesFunction · 0.85
get_passesFunction · 0.85
offload_to_mlirFunction · 0.85
get_main_moduleMethod · 0.80
test_gemmFunction · 0.70
parse_onnxFunction · 0.50
parse_tfFunction · 0.50
loadClass · 0.50
emptyMethod · 0.45

Tested by

no test coverage detected