test_gemm_copy.cpp 891 Bytes
Newer Older
1

2
#include <migraphx/apply_alpha_beta.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
21
        auto dr =
            migraphx::add_apply_alpha_beta(*mm, {pa, pb, pc}, migraphx::make_op("dot"), 1.0f, 1.0f);
22
        mm->add_instruction(migraphx::make_op("add"), dr, dr);
23
24
25
        return p;
    }
};