"src/targets/vscode:/vscode.git/clone" did not exist on "27c0fe358d6159ec3011f976a92d9f70a7fa26a4"
pass.hpp 646 Bytes
Newer Older
Paul's avatar
Paul committed
1
2
3
4
5
6
7
8
9
10
11
12
13
#ifndef MIGRAPH_GUARD_PASS_HPP
#define MIGRAPH_GUARD_PASS_HPP

#include <string>
#include <functional>
#include <memory>
#include <type_traits>
#include <utility>

namespace migraph {

struct program;

Paul's avatar
Paul committed
14
15
16
17
18
19
20
21
22
23
24
25
26
#ifdef DOXYGEN

/// This applies a transformation to the instruction in a `program`
struct pass
{
    /// A unique name used to identify the pass
    std::string name() const;
    /// Run the pass on the program
    void apply(program & p) const;
};

#else

Paul's avatar
Paul committed
27
28
29
30
31
32
33
<%
interface('pass',
    virtual('name', returns='std::string', const=True),
    virtual('apply', returns='void', p='program &', const=True)
)
%>

Paul's avatar
Paul committed
34
35
#endif

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

#endif