target.cpp 923 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
#include <migraph/dead_code_elimination.hpp>
#include <migraph/simplify_reshapes.hpp>
Paul's avatar
Paul committed
9
10

namespace migraph {
Paul's avatar
Paul committed
11
namespace gpu {
Paul's avatar
Paul committed
12

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

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

Paul's avatar
Paul committed
30
migraph::context target::get_context() const
Paul's avatar
Paul committed
31
{
Paul's avatar
Paul committed
32
    return context{share(make_obj<miopen_handle>(&miopenCreate)),
Paul's avatar
Paul committed
33
                   share(create_rocblas_handle_ptr())};
Paul's avatar
Paul committed
34
35
}

Paul's avatar
Paul committed
36
} // namespace gpu
Paul's avatar
Paul committed
37

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