compile_op.cpp 760 Bytes
Newer Older
1
2
#include <migraphx/gpu/driver/action.hpp>
#include <migraphx/gpu/driver/perf.hpp>
3
#include <migraphx/gpu/compiler.hpp>
4
5
6
7
8
9
10
#include <migraphx/gpu/context.hpp>

namespace migraphx {
inline namespace MIGRAPHX_INLINE_NS {
namespace gpu {
namespace driver {

11
struct compile_op : action<compile_op>
12
13
14
15
16
{
    static void apply(const parser& p, const value& v)
    {
        context ctx;
        auto inputs = p.parse_shapes(v.at("inputs"));
17
        auto op     = gpu::compile_op(v.at("name").to<std::string>(), ctx, inputs, v);
18
19
20
21
22
23
24
25
26
        double t    = time_op(ctx, op, inputs, p.get(v, "iterations", 100));
        std::cout << op << ": " << t << "ms" << std::endl;
    }
};

} // namespace driver
} // namespace gpu
} // namespace MIGRAPHX_INLINE_NS
} // namespace migraphx