test_gemm_copy.cpp 841 Bytes
Newer Older
1

2
#include "migraphx/common.hpp"
3
4
5
#include "verify_program.hpp"
#include <migraphx/program.hpp>
#include <migraphx/generate.hpp>
6
#include <migraphx/make_op.hpp>
7
8
9
10
11
12

struct test_gemm_copy : verify_program<test_gemm_copy>
{
    migraphx::program create_program() const
    {
        migraphx::program p;
13
        auto* mm = p.get_main_module();
14
15
        migraphx::shape sa{migraphx::shape::float_type, {2, 16}};
        migraphx::shape sb{migraphx::shape::float_type, {16, 8}};
16
        migraphx::shape sc{migraphx::shape::float_type, {1, 8}};
17
18
19
        auto pa = mm->add_parameter("a", sa);
        auto pb = mm->add_parameter("b", sb);
        auto pc = mm->add_parameter("c", sc);
20
        auto dr = migraphx::add_dot_apply_alpha_beta(*mm, {pa, pb, pc}, 1, 1);
21
        mm->add_instruction(migraphx::make_op("add"), dr, dr);
22
23
24
        return p;
    }
};