target.cpp 628 Bytes
Newer Older
Paul's avatar
Paul committed
1
2
3
4
#include <migraph/gpu/target.hpp>
#include <migraph/gpu/lowering.hpp>
#include <migraph/gpu/write_literals.hpp>
#include <migraph/gpu/context.hpp>
Paul's avatar
Paul committed
5
#include <migraph/check_context.hpp>
Paul's avatar
Paul committed
6
7

namespace migraph {
Paul's avatar
Paul committed
8
namespace gpu {
Paul's avatar
Paul committed
9

Paul's avatar
Paul committed
10
11
std::vector<pass> target::get_passes(migraph::context&) const
{
Paul's avatar
Paul committed
12
    return {lowering{}, write_literals{}, check_context<context>{}};
Paul's avatar
Paul committed
13
}
Paul's avatar
Paul committed
14

Paul's avatar
Paul committed
15
std::string target::name() const { return "miopen"; }
Paul's avatar
Paul committed
16

Paul's avatar
Paul committed
17
migraph::context target::get_context() const
Paul's avatar
Paul committed
18
{
Paul's avatar
Paul committed
19
    return context{share(make_obj<miopen_handle>(&miopenCreate)),
Paul's avatar
Paul committed
20
                   share(create_rocblas_handle_ptr())};
Paul's avatar
Paul committed
21
22
}

Paul's avatar
Paul committed
23
} // namespace gpu
Paul's avatar
Paul committed
24

Paul's avatar
Paul committed
25
} // namespace migraph