contraction_bilinear_xdl_fp64.cpp 4.33 KB
Newer Older
zjing14's avatar
zjing14 committed
1
// SPDX-License-Identifier: MIT
Illia Silin's avatar
Illia Silin committed
2
// Copyright (c) 2018-2023, Advanced Micro Devices, Inc. All rights reserved.
zjing14's avatar
zjing14 committed
3
4
5
6

#include "ck/ck.hpp"
#include "ck/tensor_operation/gpu/element/element_wise_operation.hpp"

7
#include "common_instances.hpp"
zjing14's avatar
zjing14 committed
8
9
10
11
12
13
14
15
16
17

using F64 = double;

using ADataType        = F64;
using BDataType        = F64;
using AccDataType      = F64;
using CShuffleDataType = F64;
using DDataType        = F64;
using DsDataType       = ck::Tuple<DDataType>;
using EDataType        = F64;
18
using ComputeDataType  = F64;
zjing14's avatar
zjing14 committed
19
20
21
22
23
24
25
26
27

static constexpr ck::index_t NumDimM = 2;
static constexpr ck::index_t NumDimN = 2;
static constexpr ck::index_t NumDimK = 2;

using AElementOp   = ck::tensor_operation::element_wise::PassThrough;
using BElementOp   = ck::tensor_operation::element_wise::PassThrough;
using CDEElementOp = ck::tensor_operation::element_wise::Bilinear;

28
29
30
31
32
33
34
35
36
37
38
39
40
using DeviceOpInstanceKKNN = DeviceOpInstanceKK_FP64<NumDimM,
                                                     NumDimN,
                                                     NumDimK,
                                                     ADataType,
                                                     BDataType,
                                                     AccDataType,
                                                     CShuffleDataType,
                                                     DsDataType,
                                                     EDataType,
                                                     ComputeDataType,
                                                     AElementOp,
                                                     BElementOp,
                                                     CDEElementOp>;
zjing14's avatar
zjing14 committed
41

42
43
44
45
46
47
48
49
50
51
52
53
54
using DeviceOpInstanceKNNN = DeviceOpInstanceKN_FP64<NumDimM,
                                                     NumDimN,
                                                     NumDimK,
                                                     ADataType,
                                                     BDataType,
                                                     AccDataType,
                                                     CShuffleDataType,
                                                     DsDataType,
                                                     EDataType,
                                                     ComputeDataType,
                                                     AElementOp,
                                                     BElementOp,
                                                     CDEElementOp>;
zjing14's avatar
zjing14 committed
55

56
57
58
59
60
61
62
63
64
65
66
67
68
using DeviceOpInstanceMKNN = DeviceOpInstanceMK_FP64<NumDimM,
                                                     NumDimN,
                                                     NumDimK,
                                                     ADataType,
                                                     BDataType,
                                                     AccDataType,
                                                     CShuffleDataType,
                                                     DsDataType,
                                                     EDataType,
                                                     ComputeDataType,
                                                     AElementOp,
                                                     BElementOp,
                                                     CDEElementOp>;
zjing14's avatar
zjing14 committed
69

70
71
72
73
74
75
76
77
78
79
80
81
82
using DeviceOpInstanceMNNN = DeviceOpInstanceMN_FP64<NumDimM,
                                                     NumDimN,
                                                     NumDimK,
                                                     ADataType,
                                                     BDataType,
                                                     AccDataType,
                                                     CShuffleDataType,
                                                     DsDataType,
                                                     EDataType,
                                                     ComputeDataType,
                                                     AElementOp,
                                                     BElementOp,
                                                     CDEElementOp>;
zjing14's avatar
zjing14 committed
83
84
85

using DeviceOpInstance = DeviceOpInstanceKKNN;

86
#include "run_contraction_bilinear_example.inc"
zjing14's avatar
zjing14 committed
87

88
int main(int argc, char* argv[]) { return run_contraction_bilinear_example(argc, argv); }