program.cpp 15.1 KB
Newer Older
Paul's avatar
Paul committed
1
2
3
#include <migraphx/program.hpp>
#include <migraphx/stringutils.hpp>
#include <migraphx/instruction.hpp>
4
#include <migraphx/op/identity.hpp>
Paul's avatar
Paul committed
5
#include <migraphx/target.hpp>
Paul's avatar
Paul committed
6
7
8
#include <migraphx/env.hpp>
#include <migraphx/ranges.hpp>
#include <migraphx/time.hpp>
9
#include <migraphx/pass_manager.hpp>
10
#include <migraphx/register_target.hpp>
Shucai Xiao's avatar
Shucai Xiao committed
11
#include <migraphx/iterator_for.hpp>
Paul's avatar
Paul committed
12
#include <iostream>
Paul's avatar
Paul committed
13
#include <sstream>
Paul's avatar
Paul committed
14
#include <algorithm>
15
#include <set>
Paul's avatar
Paul committed
16
#include <utility>
17

18
#include <unordered_set>
Shucai Xiao's avatar
Shucai Xiao committed
19
20
#include <map>
#include <cassert>
Paul's avatar
Paul committed
21

Paul's avatar
Paul committed
22
namespace migraphx {
Paul's avatar
Paul committed
23
inline namespace MIGRAPHX_INLINE_NS {
Paul's avatar
Paul committed
24

Paul's avatar
Paul committed
25
26
struct program_impl
{
Shucai Xiao's avatar
Shucai Xiao committed
27
28
    // A map is used to keep references to modules of the program
    std::map<std::string, module> modules;
Paul's avatar
Paul committed
29
    context ctx;
30
    std::string target_name;
Paul's avatar
Paul committed
31
32
};

Paul Fultz II's avatar
Paul Fultz II committed
33
program::program() : impl(std::make_unique<program_impl>()) { impl->modules["main"] = {"main"}; }
Paul's avatar
Paul committed
34

Paul's avatar
Paul committed
35
program::program(program&&) noexcept = default;
Shucai Xiao's avatar
Shucai Xiao committed
36
program::~program() noexcept         = default;
Paul's avatar
Paul committed
37

38
// copy constructor
Shucai Xiao's avatar
Shucai Xiao committed
39
program::program(const program& p) { assign(p); }
40
41

// copy assignment operator
Shucai Xiao's avatar
Shucai Xiao committed
42
program& program::operator=(program p)
43
{
Shucai Xiao's avatar
Shucai Xiao committed
44
    std::swap(p.impl, this->impl);
45
46
47
    return *this;
}

Shucai Xiao's avatar
Shucai Xiao committed
48
void program::assign(const program& p)
49
{
Shucai Xiao's avatar
Shucai Xiao committed
50
    if(!impl)
51
52
53
    {
        impl = std::make_unique<program_impl>();
    }
Shucai Xiao's avatar
Shucai Xiao committed
54
    else if(!impl->modules.empty())
55
    {
Shucai Xiao's avatar
Shucai Xiao committed
56
        impl->modules.clear();
57
    }
58
    impl->ctx         = p.impl->ctx;
Shucai Xiao's avatar
Shucai Xiao committed
59
60
    impl->target_name = p.impl->target_name;
    impl->modules     = p.impl->modules;
61
62
}

Paul's avatar
Paul committed
63
shape program::get_parameter_shape(std::string name) const
Paul's avatar
Paul committed
64
{
Shucai Xiao's avatar
Shucai Xiao committed
65
66
    const auto* mm = this->get_main_module();
    return mm->get_parameter_shape(std::move(name));
Paul's avatar
Paul committed
67
68
}

69
70
std::vector<std::string> program::get_parameter_names() const
{
Shucai Xiao's avatar
Shucai Xiao committed
71
72
    const auto* mm = this->get_main_module();
    return mm->get_parameter_names();
73
74
}

mei-ye's avatar
mei-ye committed
75
76
instruction_ref program::get_parameter(std::string name) const
{
Shucai Xiao's avatar
Shucai Xiao committed
77
78
    const auto* mm = this->get_main_module();
    return mm->get_parameter(std::move(name));
mei-ye's avatar
mei-ye committed
79
80
}

Paul's avatar
Paul committed
81
82
std::unordered_map<std::string, shape> program::get_parameter_shapes() const
{
Shucai Xiao's avatar
Shucai Xiao committed
83
84
    const auto* mm = this->get_main_module();
    return mm->get_parameter_shapes();
Paul's avatar
Paul committed
85
86
}

Shucai Xiao's avatar
Shucai Xiao committed
87
std::size_t program::size() const { return impl->modules.size(); }
88

89
90
std::vector<shape> program::get_output_shapes() const
{
Shucai Xiao's avatar
Shucai Xiao committed
91
92
    const auto* mm = this->get_main_module();
    return mm->get_output_shapes();
93
}
Paul's avatar
Paul committed
94

Paul's avatar
Paul committed
95
96
context& program::get_context() const { return impl->ctx; }

Paul's avatar
Paul committed
97
98
instruction_ref program::validate() const
{
Shucai Xiao's avatar
Shucai Xiao committed
99
100
    const auto* mm = this->get_main_module();
    return mm->validate();
Paul's avatar
Paul committed
101
102
}

103
104
bool program::is_compiled() const { return not this->impl->target_name.empty(); }

105
void program::compile(const target& t, compile_options options)
Paul's avatar
Paul committed
106
{
107
108
109
    assert(not this->is_compiled());
    this->impl->target_name = t.name();
    this->impl->ctx         = t.get_context();
Paul's avatar
Paul committed
110
    if(enabled(MIGRAPHX_TRACE_COMPILE{}))
111
        options.trace = tracer{std::cout};
Shucai Xiao's avatar
Shucai Xiao committed
112

113
114
    options.trace(*this);
    options.trace();
Shucai Xiao's avatar
Shucai Xiao committed
115
116
117
    auto&& passes = t.get_passes(this->impl->ctx, options);

    for(auto& mp : impl->modules)
Paul's avatar
Paul committed
118
    {
Shucai Xiao's avatar
Shucai Xiao committed
119
120
121
122
123
124
125
126
127
128
129
        auto& modl = mp.second;
        assert(modl.validate() == modl.end());
        run_passes(modl, passes, options.trace);
        auto invalid = this->validate();
        if(invalid != modl.end())
        {
            auto index = std::distance(modl.begin(), invalid);
            MIGRAPHX_THROW("Invalid module " + mp.first + " from compilation at instruction " +
                           std::to_string(index));
        }
        modl.finalize(this->impl->ctx);
Paul's avatar
Paul committed
130
    }
Paul's avatar
Paul committed
131
132
133
134
}

void program::finalize()
{
Shucai Xiao's avatar
Shucai Xiao committed
135
    for(auto& mp : this->impl->modules)
Paul's avatar
Paul committed
136
    {
Shucai Xiao's avatar
Shucai Xiao committed
137
        mp.second.finalize(this->impl->ctx);
Paul's avatar
Paul committed
138
    }
Paul's avatar
Paul committed
139
140
}

Paul's avatar
Paul committed
141
template <class F>
Shucai Xiao's avatar
Shucai Xiao committed
142
std::vector<argument> generic_eval(const module& p,
143
144
145
                                   context& ctx,
                                   std::unordered_map<std::string, argument> params,
                                   F trace)
Paul's avatar
Paul committed
146
{
Paul's avatar
Paul committed
147
    assert(p.validate() == p.end());
148
    std::unordered_map<instruction_ref, argument> results;
Paul's avatar
Paul committed
149
    results.reserve(p.size() * 2);
Paul's avatar
Paul committed
150
151
    std::vector<argument> values;
    values.reserve(16);
152
    for(auto ins : iterator_for(p))
Paul's avatar
Paul committed
153
    {
154
155
        const auto& name = ins->name();
        if(name == "@literal")
Paul's avatar
Paul committed
156
        {
Paul's avatar
Paul committed
157
            results.emplace(ins, trace(ins, [&] { return ins->get_literal().get_argument(); }));
Paul's avatar
Paul committed
158
        }
159
        else if(name == "@param")
Paul's avatar
Paul committed
160
        {
Paul's avatar
Paul committed
161
162
163
164
165
            results.emplace(
                ins, trace(ins, [&] {
                    auto param_name = any_cast<builtin::param>(ins->get_operator()).parameter;
                    if(not contains(params, param_name))
                        MIGRAPHX_THROW("Parameter not found: " + param_name);
166
                    auto param = params[param_name];
Paul's avatar
Paul committed
167
168
169
170
171
                    if(param.get_shape() != ins->get_shape())
                        MIGRAPHX_THROW("Incorrect shape {" + to_string(param.get_shape()) +
                                       "} for parameter: " + param_name);
                    return param;
                }));
Paul's avatar
Paul committed
172
        }
173
        else if(name == "@outline")
Paul's avatar
Paul committed
174
        {
Paul's avatar
Paul committed
175
            results.emplace(ins, trace(ins, [&] { return argument{ins->get_shape(), nullptr}; }));
Paul's avatar
Paul committed
176
        }
177
178
179
180
181
182
183
184
185
186
187
188
189
        else if(name == "@return")
        {
            std::vector<argument> prog_outputs;
            std::transform(ins->inputs().begin(),
                           ins->inputs().end(),
                           std::back_inserter(prog_outputs),
                           [&](instruction_ref i) {
                               assert(results.find(i) != results.end());
                               return results[i];
                           });

            return prog_outputs;
        }
Paul's avatar
Paul committed
190
191
        else
        {
Paul's avatar
Paul committed
192
            values.resize(ins->inputs().size());
Paul's avatar
Paul committed
193
194
195
196
197
            std::transform(
                ins->inputs().begin(), ins->inputs().end(), values.begin(), [&](instruction_ref i) {
                    assert(results.find(i) != results.end());
                    return results[i];
                });
Paul's avatar
Paul committed
198
            results.emplace(ins, trace(ins, [&] {
199
200
                                return ins->normalized_operator().compute(
                                    ctx, ins->get_shape(), values);
Paul's avatar
Paul committed
201
                            }));
Paul's avatar
Paul committed
202
        }
203
        assert(results.find(ins) != results.end());
Paul's avatar
Paul committed
204
    }
205

206
    return {results.at(std::prev(p.end()))};
Paul's avatar
Paul committed
207
208
}

Shucai Xiao's avatar
Shucai Xiao committed
209
210
211
212
213
214
215
216
217
218
template <class F>
std::vector<argument> generic_eval(const program& p,
                                   context& ctx,
                                   std::unordered_map<std::string, argument> params,
                                   F trace)
{
    const auto* mm = p.get_main_module();
    return generic_eval(*mm, ctx, params, trace);
}

219
std::vector<argument> program::eval(parameter_map params) const
Paul's avatar
Paul committed
220
{
Paul's avatar
Paul committed
221
222
    auto& ctx = this->impl->ctx;
#ifndef NDEBUG
Paul's avatar
Paul committed
223
    auto sctx          = ctx;
Paul's avatar
Paul committed
224
225
226
    auto check_context = [&](auto f) {
        assert(is_shared(ctx, sctx));
        auto x = f();
Paul's avatar
Paul committed
227
        sctx   = ctx;
Paul's avatar
Paul committed
228
229
230
        return x;
    };
#else
Paul's avatar
Paul committed
231
    auto check_context = [](auto f) { return f(); };
Paul's avatar
Paul committed
232
#endif
Paul's avatar
Paul committed
233
234
235
236

    auto trace_level = value_of(MIGRAPHX_TRACE_EVAL{});

    if(trace_level > 0)
Paul's avatar
Paul committed
237
    {
Paul's avatar
Paul committed
238
        return generic_eval(*this, ctx, std::move(params), [&](auto& ins, auto f) {
Paul's avatar
Paul committed
239
            ctx.finish();
Paul's avatar
Paul committed
240
241
            std::cout << "Run instruction: ";
            this->debug_print(ins);
Paul's avatar
Paul committed
242
243
            auto result = check_context(f);
            ctx.finish();
Paul's avatar
Paul committed
244
            if(trace_level > 1 and ins->name().front() != '@' and ins->name() != "load")
Paul's avatar
Paul committed
245
246
                std::cout << "Ouput: " << result << std::endl;
            return result;
Paul's avatar
Paul committed
247
        });
Paul's avatar
Paul committed
248
249
250
251
    }
    else
    {
        return generic_eval(
Paul's avatar
Paul committed
252
            *this, ctx, std::move(params), [&](auto&, auto f) { return check_context(f); });
Paul's avatar
Paul committed
253
    }
Paul's avatar
Paul committed
254
255
}

256
const int program_file_version = 4;
257
258
259
260
261
262
263
264

value program::to_value() const
{
    value result;
    result["version"] = program_file_version;
    result["target"]  = this->impl->target_name;
    if(not this->impl->target_name.empty())
        result["context"] = this->impl->ctx.to_value();
Shucai Xiao's avatar
Shucai Xiao committed
265
266
267
268
269
270
271

    result["modules"] = value::object{};
    auto& module_val  = result.at("modules");
    for(auto& m : impl->modules)
    {
        module_val[m.first] = m.second.to_value();
    }
272
273
    return result;
}
Shucai Xiao's avatar
Shucai Xiao committed
274

275
276
277
278
void program::from_value(const value& v)
{
    auto version = v.at("version").to<int>();
    if(version != program_file_version)
Shucai Xiao's avatar
Shucai Xiao committed
279
280
281
282
    {
        MIGRAPHX_THROW("Warning: Program version mismatch");
    }

283
284
285
286
287
288
289
290
    this->impl->target_name = v.at("target").to<std::string>();
    if(not this->impl->target_name.empty())
    {
        target t        = make_target(this->impl->target_name);
        this->impl->ctx = t.get_context();
        this->impl->ctx.from_value(v.at("context"));
    }

Shucai Xiao's avatar
Shucai Xiao committed
291
292
    auto val_modules = v.at("modules");
    for(const auto& vv : val_modules)
293
    {
Shucai Xiao's avatar
Shucai Xiao committed
294
295
        const auto& key = vv.get_key();
        auto val        = vv.without_key();
Paul Fultz II's avatar
Paul Fultz II committed
296
        module modl{key};
Shucai Xiao's avatar
Shucai Xiao committed
297
298
        modl.from_value(val);
        impl->modules[key] = modl;
299
300
301
302
    }
    this->finalize();
}

Paul's avatar
Paul committed
303
304
305
double common_average(const std::vector<double>& v)
{
    std::size_t n = v.size() / 4;
Paul's avatar
Paul committed
306
307
    double total  = std::accumulate(v.begin() + n, v.end() - n, 0.0);
    return total / std::distance(v.begin() + n, v.end() - n);
Paul's avatar
Paul committed
308
309
}

Paul's avatar
Paul committed
310
311
312
void program::perf_report(std::ostream& os, std::size_t n, parameter_map params) const
{
    using milliseconds = std::chrono::duration<double, std::milli>;
Paul's avatar
Paul committed
313
    auto& ctx          = this->impl->ctx;
Paul's avatar
Paul committed
314
315
    // Run once by itself
    eval(params);
Paul's avatar
Paul committed
316
    ctx.finish();
Paul's avatar
Paul committed
317
    // Run and time entire program
Paul's avatar
Paul committed
318
319
    std::vector<double> total_vec;
    total_vec.reserve(n);
Paul's avatar
Paul committed
320
    for(std::size_t i = 0; i < n; i++)
Paul's avatar
Paul committed
321
    {
Paul's avatar
Paul committed
322
323
324
325
        total_vec.push_back(time<milliseconds>([&] {
            eval(params);
            ctx.finish();
        }));
Paul's avatar
Paul committed
326
    }
Paul's avatar
Paul committed
327
328
    std::sort(total_vec.begin(), total_vec.end());
    std::unordered_map<instruction_ref, std::vector<double>> ins_vec;
Paul's avatar
Paul committed
329
    // Fill the map
Paul's avatar
Paul committed
330
    generic_eval(*this, ctx, params, [&](auto ins, auto) {
Paul's avatar
Paul committed
331
        ins_vec[ins].reserve(n);
Paul's avatar
Paul committed
332
333
        return argument{};
    });
Paul's avatar
Paul committed
334
    // Run and time each instruction
Paul's avatar
Paul committed
335
    for(std::size_t i = 0; i < n; i++)
Paul's avatar
Paul committed
336
    {
Paul's avatar
Paul committed
337
        generic_eval(*this, ctx, params, [&](auto ins, auto f) {
338
            argument result;
Paul's avatar
Paul committed
339
340
341
342
            ins_vec[ins].push_back(time<milliseconds>([&] {
                result = f();
                ctx.finish();
            }));
343
            return result;
Paul's avatar
Paul committed
344
345
        });
    }
Paul's avatar
Paul committed
346
347
    for(auto&& p : ins_vec)
        std::sort(p.second.begin(), p.second.end());
Paul's avatar
Paul committed
348
    // Run and time implicit overhead
Paul's avatar
Paul committed
349
350
    std::vector<double> overhead_vec;
    overhead_vec.reserve(n);
Paul's avatar
Paul committed
351
    for(std::size_t i = 0; i < n; i++)
Paul's avatar
Paul committed
352
    {
Paul's avatar
Paul committed
353
        overhead_vec.push_back(time<milliseconds>([&] { dry_run(params); }));
Paul's avatar
Paul committed
354
355
    }

Paul's avatar
Paul committed
356
    double total_time             = common_average(total_vec);
Paul's avatar
Paul committed
357
    double rate                   = 1000.0 / total_time;
Paul's avatar
Paul committed
358
    double overhead_time          = common_average(overhead_vec);
Paul's avatar
Paul committed
359
    double overhead_percent       = overhead_time * 100.0 / total_time;
Paul's avatar
Paul committed
360
    double total_instruction_time = 0.0;
Paul's avatar
Paul committed
361
    std::unordered_map<std::string, double> op_times;
Paul's avatar
Paul committed
362
    for(auto&& p : ins_vec)
Paul's avatar
Paul committed
363
364
    {
        double avg = common_average(p.second);
Paul's avatar
Paul committed
365
        op_times[p.first->name()] += avg;
Paul's avatar
Paul committed
366
367
        total_instruction_time += avg;
    }
Paul's avatar
Paul committed
368
369
    double calculate_overhead_time    = total_time - total_instruction_time;
    double calculate_overhead_percent = calculate_overhead_time * 100.0 / total_time;
Paul's avatar
Paul committed
370

Shucai Xiao's avatar
Shucai Xiao committed
371
    this->print([&](auto ins, auto names) {
372
        instruction::print(std::cout, ins, names);
373
374
375
376
377

        // skip return instruction
        if(ins->name() == "@return")
            return;

Paul's avatar
Paul committed
378
379
380
        double avg     = common_average(ins_vec[ins]);
        double percent = std::ceil(100.0 * avg / total_instruction_time);
        os << ": " << avg << "ms, " << percent << "%";
381
        os << std::endl;
Paul's avatar
Paul committed
382
    });
Paul's avatar
Paul committed
383
384
385

    os << std::endl;
    os << "Summary:" << std::endl;
386
387
388
389
390
391
392
    std::vector<std::pair<double, std::string>> op_times_sorted;
    std::transform(op_times.begin(),
                   op_times.end(),
                   std::back_inserter(op_times_sorted),
                   [](auto p) { return std::make_pair(p.second, p.first); });
    std::sort(op_times_sorted.begin(), op_times_sorted.end(), std::greater<>{});
    for(auto&& p : op_times_sorted)
Paul's avatar
Paul committed
393
    {
394
395
        auto&& name    = p.second;
        double avg     = p.first;
Paul's avatar
Paul committed
396
397
398
399
400
        double percent = std::ceil(100.0 * avg / total_instruction_time);
        os << name << ": " << avg << "ms, " << percent << "%" << std::endl;
    }

    os << std::endl;
Paul's avatar
Paul committed
401

Paul's avatar
Paul committed
402
    os << "Rate: " << rate << "/sec" << std::endl;
Paul's avatar
Paul committed
403
404
    os << "Total time: " << total_time << "ms" << std::endl;
    os << "Total instructions time: " << total_instruction_time << "ms" << std::endl;
Paul's avatar
Paul committed
405
406
407
408
    os << "Overhead time: " << overhead_time << "ms"
       << ", " << calculate_overhead_time << "ms" << std::endl;
    os << "Overhead: " << std::round(overhead_percent) << "%"
       << ", " << std::round(calculate_overhead_percent) << "%" << std::endl;
Paul's avatar
Paul committed
409
410
}

Paul's avatar
Paul committed
411
412
void program::debug_print() const { std::cout << *this << std::endl; }
void program::debug_print(instruction_ref ins) const
Paul's avatar
Paul committed
413
{
414
    if(std::any_of(this->impl->modules.begin(), this->impl->modules.end(), [&](const auto& it) {
Shucai Xiao's avatar
Shucai Xiao committed
415
416
           return (it.second.end() == ins);
       }))
Paul's avatar
Paul committed
417
418
419
420
    {
        std::cout << "End instruction" << std::endl;
        return;
    }
421
422
423
    else if(std::none_of(this->impl->modules.begin(),
                         this->impl->modules.end(),
                         [&](const auto& it) { return it.second.has_instruction(ins); }))
Paul's avatar
Paul committed
424
425
426
427
    {
        std::cout << "Instruction not part of program" << std::endl;
        return;
    }
Shucai Xiao's avatar
Shucai Xiao committed
428

Paul's avatar
Paul committed
429
    std::stringstream ss;
Shucai Xiao's avatar
Shucai Xiao committed
430
    this->print([&](auto x, const auto& names) {
Paul's avatar
Paul committed
431
        if(x == ins)
Paul's avatar
Paul committed
432
        {
433
            instruction::print(std::cout, x, names);
Paul's avatar
Paul committed
434
435
436
437
438
            std::cout << std::endl;
        }
    });
}

Shucai Xiao's avatar
Shucai Xiao committed
439
440
441
void program::print(const std::function<
                    void(instruction_ref, const std::unordered_map<instruction_ref, std::string>&)>&
                        print_func) const
442
{
Shucai Xiao's avatar
Shucai Xiao committed
443
    for(const auto& mdl : this->impl->modules)
444
    {
Shucai Xiao's avatar
Shucai Xiao committed
445
        mdl.second.print(print_func);
446
447
448
    }
}

Shucai Xiao's avatar
Shucai Xiao committed
449
void program::print_graph(std::ostream& os, bool brief) const
450
{
Shucai Xiao's avatar
Shucai Xiao committed
451
452
    const auto* mm = this->get_main_module();
    mm->print_graph(os, brief);
453
454
455
456
457
}

void program::print_cpp(std::ostream& os) const
{
    os << "migraphx::program p;" << std::endl;
Shucai Xiao's avatar
Shucai Xiao committed
458
459
    const auto* mm = this->get_main_module();
    mm->print_cpp(os);
460
461
}

Paul's avatar
Paul committed
462
463
void program::dry_run(std::unordered_map<std::string, argument> params) const
{
Paul's avatar
Paul committed
464
    auto& ctx = this->impl->ctx;
Paul's avatar
Paul committed
465
    generic_eval(*this, ctx, std::move(params), [](auto&&...) { return argument{}; });
Paul's avatar
Paul committed
466
467
}

Shucai Xiao's avatar
Shucai Xiao committed
468
void program::annotate(std::ostream& os, const std::function<void(instruction_ref)>& a) const
Paul's avatar
Paul committed
469
{
Shucai Xiao's avatar
Shucai Xiao committed
470
471
472
473
474
    for(auto& modl : this->impl->modules)
    {
        std::cout << modl.first << ":" << std::endl;
        modl.second.annotate(os, a);
    }
Paul's avatar
Paul committed
475
476
}

Paul Fultz II's avatar
Paul Fultz II committed
477
module* program::get_main_module() { return &impl->modules.at("main"); }
Shucai Xiao's avatar
Shucai Xiao committed
478

Paul Fultz II's avatar
Paul Fultz II committed
479
const module* program::get_main_module() const { return &impl->modules.at("main"); }
Shucai Xiao's avatar
Shucai Xiao committed
480

481
482
program& program::sort()
{
Shucai Xiao's avatar
Shucai Xiao committed
483
484
485
486
487
    for(auto& modl : this->impl->modules)
    {
        modl.second.sort();
    }

488
489
490
    return *this;
}

Paul's avatar
Paul committed
491
bool operator==(const program& x, const program& y) { return to_string(x) == to_string(y); }
Paul's avatar
Paul committed
492

Paul's avatar
Paul committed
493
std::ostream& operator<<(std::ostream& os, const program& p)
Paul's avatar
Paul committed
494
{
Shucai Xiao's avatar
Shucai Xiao committed
495
496
497
498
    for(auto& mp : p.impl->modules)
    {
        os << "Module " << mp.first << ": " << std::endl;
        os << mp.second;
499
        os << std::endl;
Shucai Xiao's avatar
Shucai Xiao committed
500
501
    }

Paul's avatar
Paul committed
502
    return os;
Paul's avatar
Paul committed
503
}
Paul's avatar
Paul committed
504

Paul's avatar
Paul committed
505
} // namespace MIGRAPHX_INLINE_NS
Paul's avatar
Paul committed
506
} // namespace migraphx