| 30 | #include "test.hpp" |
| 31 | |
| 32 | TEST_CASE(load_and_run) |
| 33 | { |
| 34 | auto p = read_onnx("conv_relu_maxpool_test.onnx"); |
| 35 | auto shapes_before = p.get_output_shapes(); |
| 36 | migraphx::compile_options options; |
| 37 | options.set_offload_copy(); |
| 38 | p.compile(migraphx::target("gpu"), options); |
| 39 | auto shapes_after = p.get_output_shapes(); |
| 40 | CHECK(shapes_before.size() == 1); |
| 41 | CHECK(shapes_before.size() == shapes_after.size()); |
| 42 | CHECK(shapes_before.front() == shapes_after.front()); |
| 43 | migraphx::program_parameters pp; |
| 44 | auto param_shapes = p.get_parameter_shapes(); |
| 45 | for(auto&& name : param_shapes.names()) |
| 46 | { |
| 47 | pp.add(name, migraphx::argument::generate(param_shapes[name])); |
| 48 | } |
| 49 | |
| 50 | auto outputs = p.eval(pp); |
| 51 | CHECK(shapes_before.size() == outputs.size()); |
| 52 | CHECK(shapes_before.front() == outputs.front().get_shape()); |
| 53 | } |
| 54 | |
| 55 | using hip_ptr = MIGRAPHX_MANAGE_PTR(void, hipFree); |
| 56 | using stream_ptr = MIGRAPHX_MANAGE_PTR(hipStream_t, hipStreamDestroy); |
nothing calls this directly
no test coverage detected