target.cpp 775 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
#include <migraph/auto_contiguous.hpp>
Paul's avatar
Paul committed
7
8

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

Paul's avatar
Paul committed
11
12
std::vector<pass> target::get_passes(migraph::context&) const
{
Paul's avatar
Paul committed
13
14
15
16
17
18
19
20
21
    // clang-format off
    return
    {
        auto_contiguous{},
        lowering{},
        write_literals{},
        check_context<context>{}
    };
    // clang-format on
Paul's avatar
Paul committed
22
}
Paul's avatar
Paul committed
23

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

Paul's avatar
Paul committed
26
migraph::context target::get_context() const
Paul's avatar
Paul committed
27
{
Paul's avatar
Paul committed
28
    return context{share(make_obj<miopen_handle>(&miopenCreate)),
Paul's avatar
Paul committed
29
                   share(create_rocblas_handle_ptr())};
Paul's avatar
Paul committed
30
31
}

Paul's avatar
Paul committed
32
} // namespace gpu
Paul's avatar
Paul committed
33

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