device_gemm.hpp 1.36 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
#ifndef DEVICE_GEMM_HPP
#define DEVICE_GEMM_HPP

#include <iostream>
#include "device_base.hpp"

namespace ck {
namespace tensor_operation {
namespace device {

Chao Liu's avatar
Chao Liu committed
11
12
13
template <typename AElementwiseOperation,
          typename BElementwiseOperation,
          typename CElementwiseOperation>
14
15
struct DeviceGemm : public BaseOperator
{
Chao Liu's avatar
Chao Liu committed
16
17
18
19
20
21
22
23
24
25
26
27
    virtual std::unique_ptr<BaseArgument>
    MakeArgumentPointer(const void* p_a,
                        const void* p_b,
                        void* p_c,
                        ck::index_t M,
                        ck::index_t N,
                        ck::index_t K,
                        ck::index_t StrideA,
                        ck::index_t StrideB,
                        ck::index_t StrideC,
                        AElementwiseOperation a_element_op,
                        BElementwiseOperation b_element_op,
ltqin's avatar
ltqin committed
28
29
                        CElementwiseOperation c_element_op,
                        ck::index_t desired_gride_size = 1) = 0;
30
31
32
33

    virtual std::unique_ptr<BaseInvoker> MakeInvokerPointer() = 0;
};

Chao Liu's avatar
Chao Liu committed
34
35
36
37
38
template <typename AElementwiseOperation,
          typename BElementwiseOperation,
          typename CElementwiseOperation>
using DeviceGemmPtr = std::unique_ptr<
    DeviceGemm<AElementwiseOperation, BElementwiseOperation, CElementwiseOperation>>;
39
40
41
42
43

} // namespace device
} // namespace tensor_operation
} // namespace ck
#endif