int8_gemm_pack.cpp 1.04 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#include <migraphx/gpu/int8_gemm_pack.hpp>
#include <migraphx/gpu/device/int8_gemm_pack.hpp>
#include <migraphx/gpu/context.hpp>

namespace migraphx {
inline namespace MIGRAPHX_INLINE_NS {
namespace gpu {

shape hip_int8_gemm_pack_a::compute_shape(const std::vector<shape>& inputs) const
{
    check_shapes{{inputs.at(0)}, *this}.has(1).not_broadcasted().packed();
    return inputs.at(0);
}

Shucai Xiao's avatar
Shucai Xiao committed
15
16
argument
hip_int8_gemm_pack_a::compute(context& ctx, const shape&, const std::vector<argument>& args) const
17
18
19
20
21
22
23
24
25
26
27
{
    device::int8_gemm_pack_a(ctx.get_stream().get(), args[1], args[0]);
    return args[1];
}

shape hip_int8_gemm_pack_b::compute_shape(const std::vector<shape>& inputs) const
{
    check_shapes{{inputs.at(0)}, *this}.has(1).not_broadcasted().packed();
    return inputs.at(0);
}

Shucai Xiao's avatar
Shucai Xiao committed
28
29
argument
hip_int8_gemm_pack_b::compute(context& ctx, const shape&, const std::vector<argument>& args) const
30
31
32
33
34
35
36
37
{
    device::int8_gemm_pack_b(ctx.get_stream().get(), args[1], args[0]);
    return args[1];
}

} // namespace gpu
} // namespace MIGRAPHX_INLINE_NS
} // namespace migraphx