target.cpp 1.16 KB
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>
9
#include <migraph/eliminate_contiguous.hpp>
Paul's avatar
Paul committed
10
11

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

Paul's avatar
Paul committed
14
std::vector<pass> target::get_passes(migraph::context& gctx) const
Paul's avatar
Paul committed
15
{
Paul's avatar
Paul committed
16
    auto& ctx = any_cast<context>(gctx);
Paul's avatar
Paul committed
17
18
19
    // clang-format off
    return
    {
20
        //dead_code_elimination{},
Paul's avatar
Paul committed
21
        auto_contiguous{},
22
23
        //simplify_reshapes{},
        //dead_code_elimination{},
Paul's avatar
Paul committed
24
        lowering{ctx},
25
26
27
        //eliminate_contiguous{},
        //dead_code_elimination{},
        //write_literals{},
Paul's avatar
Paul committed
28
        write_literals{},
29
        //check_context<context>{},
30
        dead_code_elimination{}
Paul's avatar
Paul committed
31
32
    };
    // clang-format on
Paul's avatar
Paul committed
33
}
Paul's avatar
Paul committed
34

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

Paul's avatar
Paul committed
37
migraph::context target::get_context() const
Paul's avatar
Paul committed
38
{
Paul's avatar
Paul committed
39
    return context{share(make_obj<miopen_handle>(&miopenCreate)),
Paul's avatar
Paul committed
40
                   share(create_rocblas_handle_ptr())};
Paul's avatar
Paul committed
41
42
}

Paul's avatar
Paul committed
43
} // namespace gpu
Paul's avatar
Paul committed
44

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