"testing/vscode:/vscode.git/clone" did not exist on "f23c4d305d196cfffac580f7e1c228121d993ba8"
optimize.cpp 493 Bytes
Newer Older
mei-ye's avatar
staging  
mei-ye committed
1
#include <migraph/optimize.hpp>
mei-ye's avatar
staging  
mei-ye committed
2
#include "memory_coloring.hpp"
mei-ye's avatar
staging  
mei-ye committed
3
4
5
6
7

namespace migraph {
void optimize::apply(program &p) const
{
    std::cout << p << std::endl;
mei-ye's avatar
staging  
mei-ye committed
8
9
10
11
12
13
14
15
16
    memory_coloring opt(&p);
    opt.run();
    int ins_enum = p.get_size();
    if (ins_enum == 0)
        return;
    instruction_ref iter_ins = std::prev(p.end());
    instruction_ref first_ins = p.begin();
    do {
        iter_ins = std::prev(iter_ins);
mei-ye's avatar
staging  
mei-ye committed
17
        
mei-ye's avatar
staging  
mei-ye committed
18
19
    } while (iter_ins != first_ins);
    
mei-ye's avatar
staging  
mei-ye committed
20
21
}
} // namespace migraph