Unverified Commit 77665f58 authored by Cagri Eryilmaz's avatar Cagri Eryilmaz Committed by GitHub
Browse files

Cpp example update (#842)



* changes for CPP mnist example for cpu bug

* formatting

* one liner for input parameter

* generalizing input name

* clang format
Co-authored-by: default avatarmvermeulen <5479696+mvermeulen@users.noreply.github.com>
parent e48b9e09
...@@ -118,7 +118,7 @@ This directory contains everything that is needed to perform inference on an MNI ...@@ -118,7 +118,7 @@ This directory contains everything that is needed to perform inference on an MNI
``` ```
$ mkdir build $ mkdir build
$ cd build $ cd build
$ cmake .. $ CXX=/opt/rocm/llvm/bin/clang++ cmake ..
$ make $ make
``` ```
There will now be an executable named `mnist_inference` in the `build` directory. This can be run with or without options. Executing without any options will produce the following output: There will now be an executable named `mnist_inference` in the `build` directory. This can be run with or without options. Executing without any options will produce the following output:
......
...@@ -122,10 +122,8 @@ int main(int argc, char** argv) ...@@ -122,10 +122,8 @@ int main(int argc, char** argv)
migraphx::program_parameters prog_params; migraphx::program_parameters prog_params;
auto param_shapes = prog.get_parameter_shapes(); auto param_shapes = prog.get_parameter_shapes();
for(auto&& name : param_shapes.names()) auto input = param_shapes.names().front();
{ prog_params.add(input, migraphx::argument(param_shapes[input], digit.data()));
prog_params.add(name, migraphx::argument(param_shapes[name], digit.data()));
}
std::cout << "Model evaluating input..." << std::endl; std::cout << "Model evaluating input..." << std::endl;
auto start = std::chrono::high_resolution_clock::now(); auto start = std::chrono::high_resolution_clock::now();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment