program_test.cpp 680 Bytes
Newer Older
Paul's avatar
Paul committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32

#include <migraph/program.hpp>
#include <migraph/iterator_for.hpp>
#include <migraph/instruction.hpp>
#include <sstream>
#include "test.hpp"
#include <basic_ops.hpp>

migraph::program create_program()
{
    migraph::program p;

    auto x = p.add_parameter("x", {migraph::shape::int64_type});
    auto y = p.add_parameter("y", {migraph::shape::int64_type});

    auto sum = p.add_instruction(sum_op{}, x, y);
    auto one  = p.add_literal(1);
    p.add_instruction(sum_op{}, sum, one);

    return p;
}

void program_equality() 
{
    migraph::program x = create_program();
    migraph::program y = create_program();
    EXPECT(x == y);
}

int main() {
    program_equality();
}