program_test.cpp 674 Bytes
Newer Older
Paul's avatar
Paul committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16

#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);
Paul's avatar
Paul committed
17
    auto one = p.add_literal(1);
Paul's avatar
Paul committed
18
19
20
21
22
    p.add_instruction(sum_op{}, sum, one);

    return p;
}

Paul's avatar
Paul committed
23
void program_equality()
Paul's avatar
Paul committed
24
25
26
27
28
29
{
    migraph::program x = create_program();
    migraph::program y = create_program();
    EXPECT(x == y);
}

Paul's avatar
Paul committed
30
int main() { program_equality(); }