| 81 | } |
| 82 | |
| 83 | std::vector<char> save_buffer(const program& p, const file_options& options) |
| 84 | { |
| 85 | value v = p.to_value(); |
| 86 | print_miopen_warning(p); |
| 87 | std::vector<char> buffer; |
| 88 | if(options.format == "msgpack") |
| 89 | { |
| 90 | buffer = to_msgpack(v); |
| 91 | } |
| 92 | else if(options.format == "json") |
| 93 | { |
| 94 | std::string s = to_json_string(v); |
| 95 | buffer = std::vector<char>(s.begin(), s.end()); |
| 96 | } |
| 97 | else |
| 98 | { |
| 99 | MIGRAPHX_THROW("Unknown format: " + options.format); |
| 100 | } |
| 101 | return buffer; |
| 102 | } |
| 103 | |
| 104 | } // namespace MIGRAPHX_INLINE_NS |
| 105 | } // namespace migraphx |
no test coverage detected