Debian Codegraph @

packages/kokkos-kernels/batched/dense/unit_test/Test_Batched_BatchedGemm_Real.hpp

raw
1 //@HEADER
2 // ************************************************************************
3 //
4 // Kokkos v. 4.0
5 // Copyright (2022) National Technology & Engineering
6 // Solutions of Sandia, LLC (NTESS).
7 //
8 // Under the terms of Contract DE-NA0003525 with NTESS,
9 // the U.S. Government retains certain rights in this software.
10 //
11 // Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions.
12 // See https://kokkos.org/LICENSE for license information.
13 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
14 //
15 //@HEADER
16
17 // We do not ETI half-types. Only test this if ETI ONLY is off
18 // and bhalf_t is not an alias to float.
19 #if !defined(KOKKOSKERNELS_ETI_ONLY) && !defined(KOKKOSKERNELS_IMPL_CHECK_ETI_CALLS) && \
20 defined(KOKKOS_BHALF_T_IS_FLOAT) && !KOKKOS_BHALF_T_IS_FLOAT
21 /********************* BatchLayout::Left *********************/
22 TEST_F(TestCategory, batched_scalar_batched_gemm_nt_nt_bhalf_bhalf_left) {
23 typedef ::Test::SharedParamTag<Trans::NoTranspose, Trans::NoTranspose, BatchLayout::Left> param_tag_type;
24
25 test_batched_gemm<TestDevice, ::Test::bhalfScalarType, ::Test::bhalfScalarType, param_tag_type>();
26 }
27 TEST_F(TestCategory, batched_scalar_batched_gemm_t_nt_bhalf_bhalf_left) {
28 typedef ::Test::SharedParamTag<Trans::Transpose, Trans::NoTranspose, BatchLayout::Left> param_tag_type;
29
30 test_batched_gemm<TestDevice, ::Test::bhalfScalarType, ::Test::bhalfScalarType, param_tag_type>();
31 }
32 TEST_F(TestCategory, batched_scalar_batched_gemm_nt_t_bhalf_bhalf_left) {
33 typedef ::Test::SharedParamTag<Trans::NoTranspose, Trans::Transpose, BatchLayout::Left> param_tag_type;
34
35 test_batched_gemm<TestDevice, ::Test::bhalfScalarType, ::Test::bhalfScalarType, param_tag_type>();
36 }
37 TEST_F(TestCategory, batched_scalar_batched_gemm_t_t_bhalf_bhalf_left) {
38 typedef ::Test::SharedParamTag<Trans::Transpose, Trans::Transpose, BatchLayout::Left> param_tag_type;
39
40 test_batched_gemm<TestDevice, ::Test::bhalfScalarType, ::Test::bhalfScalarType, param_tag_type>();
41 }
42 /********************* BatchLayout::Right *********************/
43 TEST_F(TestCategory, batched_scalar_batched_gemm_nt_nt_bhalf_bhalf_right) {
44 typedef ::Test::SharedParamTag<Trans::NoTranspose, Trans::NoTranspose, BatchLayout::Right> param_tag_type;
45
46 test_batched_gemm<TestDevice, ::Test::bhalfScalarType, ::Test::bhalfScalarType, param_tag_type>();
47 }
48 TEST_F(TestCategory, batched_scalar_batched_gemm_t_nt_bhalf_bhalf_right) {
49 typedef ::Test::SharedParamTag<Trans::Transpose, Trans::NoTranspose, BatchLayout::Right> param_tag_type;
50
51 test_batched_gemm<TestDevice, ::Test::bhalfScalarType, ::Test::bhalfScalarType, param_tag_type>();
52 }
53 TEST_F(TestCategory, batched_scalar_batched_gemm_nt_t_bhalf_bhalf_right) {
54 typedef ::Test::SharedParamTag<Trans::NoTranspose, Trans::Transpose, BatchLayout::Right> param_tag_type;
55
56 test_batched_gemm<TestDevice, ::Test::bhalfScalarType, ::Test::bhalfScalarType, param_tag_type>();
57 }
58 TEST_F(TestCategory, batched_scalar_batched_gemm_t_t_bhalf_bhalf_right) {
59 typedef ::Test::SharedParamTag<Trans::Transpose, Trans::Transpose, BatchLayout::Right> param_tag_type;
60
61 test_batched_gemm<TestDevice, ::Test::bhalfScalarType, ::Test::bhalfScalarType, param_tag_type>();
62 }
63 #endif // KOKKOS_BHALF_T_IS_FLOAT
64
65 // We do not ETI half-types. Only test this if ETI ONLY is off
66 // and half_t is not an alias to float.
67 #if !defined(KOKKOSKERNELS_ETI_ONLY) && !defined(KOKKOSKERNELS_IMPL_CHECK_ETI_CALLS) && \
68 defined(KOKKOS_HALF_T_IS_FLOAT) && !KOKKOS_HALF_T_IS_FLOAT
69 /********************* BatchLayout::Left *********************/
70 TEST_F(TestCategory, batched_scalar_batched_gemm_nt_nt_half_half_left) {
71 typedef ::Test::SharedParamTag<Trans::NoTranspose, Trans::NoTranspose, BatchLayout::Left> param_tag_type;
72
73 test_batched_gemm<TestDevice, ::Test::halfScalarType, ::Test::halfScalarType, param_tag_type>();
74 }
75 TEST_F(TestCategory, batched_scalar_batched_gemm_t_nt_half_half_left) {
76 typedef ::Test::SharedParamTag<Trans::Transpose, Trans::NoTranspose, BatchLayout::Left> param_tag_type;
77
78 test_batched_gemm<TestDevice, ::Test::halfScalarType, ::Test::halfScalarType, param_tag_type>();
79 }
80 TEST_F(TestCategory, batched_scalar_batched_gemm_nt_t_half_half_left) {
81 typedef ::Test::SharedParamTag<Trans::NoTranspose, Trans::Transpose, BatchLayout::Left> param_tag_type;
82
83 test_batched_gemm<TestDevice, ::Test::halfScalarType, ::Test::halfScalarType, param_tag_type>();
84 }
85 TEST_F(TestCategory, batched_scalar_batched_gemm_t_t_half_half_left) {
86 typedef ::Test::SharedParamTag<Trans::Transpose, Trans::Transpose, BatchLayout::Left> param_tag_type;
87
88 test_batched_gemm<TestDevice, ::Test::halfScalarType, ::Test::halfScalarType, param_tag_type>();
89 }
90 /********************* BatchLayout::Right *********************/
91 TEST_F(TestCategory, batched_scalar_batched_gemm_nt_nt_half_half_right) {
92 typedef ::Test::SharedParamTag<Trans::NoTranspose, Trans::NoTranspose, BatchLayout::Right> param_tag_type;
93
94 test_batched_gemm<TestDevice, ::Test::halfScalarType, ::Test::halfScalarType, param_tag_type>();
95 }
96 TEST_F(TestCategory, batched_scalar_batched_gemm_t_nt_half_half_right) {
97 typedef ::Test::SharedParamTag<Trans::Transpose, Trans::NoTranspose, BatchLayout::Right> param_tag_type;
98
99 test_batched_gemm<TestDevice, ::Test::halfScalarType, ::Test::halfScalarType, param_tag_type>();
100 }
101 TEST_F(TestCategory, batched_scalar_batched_gemm_nt_t_half_half_right) {
102 typedef ::Test::SharedParamTag<Trans::NoTranspose, Trans::Transpose, BatchLayout::Right> param_tag_type;
103
104 test_batched_gemm<TestDevice, ::Test::halfScalarType, ::Test::halfScalarType, param_tag_type>();
105 }
106 TEST_F(TestCategory, batched_scalar_batched_gemm_t_t_half_half_right) {
107 typedef ::Test::SharedParamTag<Trans::Transpose, Trans::Transpose, BatchLayout::Right> param_tag_type;
108
109 test_batched_gemm<TestDevice, ::Test::halfScalarType, ::Test::halfScalarType, param_tag_type>();
110 }
111 #endif // KOKKOS_HALF_T_IS_FLOAT
112
113 #if defined(KOKKOSKERNELS_INST_FLOAT)
114 /********************* BatchLayout::Left *********************/
115 TEST_F(TestCategory, batched_scalar_batched_gemm_nt_nt_float_float_left) {
116 typedef ::Test::SharedParamTag<Trans::NoTranspose, Trans::NoTranspose, BatchLayout::Left> param_tag_type;
117
118 test_batched_gemm<TestDevice, float, float, param_tag_type>();
119 }
120 TEST_F(TestCategory, batched_scalar_batched_gemm_t_nt_float_float_left) {
121 typedef ::Test::SharedParamTag<Trans::Transpose, Trans::NoTranspose, BatchLayout::Left> param_tag_type;
122
123 test_batched_gemm<TestDevice, float, float, param_tag_type>();
124 }
125 TEST_F(TestCategory, batched_scalar_batched_gemm_nt_t_float_float_left) {
126 typedef ::Test::SharedParamTag<Trans::NoTranspose, Trans::Transpose, BatchLayout::Left> param_tag_type;
127
128 test_batched_gemm<TestDevice, float, float, param_tag_type>();
129 }
130 TEST_F(TestCategory, batched_scalar_batched_gemm_t_t_float_float_left) {
131 typedef ::Test::SharedParamTag<Trans::Transpose, Trans::Transpose, BatchLayout::Left> param_tag_type;
132
133 test_batched_gemm<TestDevice, float, float, param_tag_type>();
134 }
135 /********************* BatchLayout::Right *********************/
136 TEST_F(TestCategory, batched_scalar_batched_gemm_nt_nt_float_float_right) {
137 typedef ::Test::SharedParamTag<Trans::NoTranspose, Trans::NoTranspose, BatchLayout::Right> param_tag_type;
138
139 test_batched_gemm<TestDevice, float, float, param_tag_type>();
140 }
141 TEST_F(TestCategory, batched_scalar_batched_gemm_t_nt_float_float_right) {
142 typedef ::Test::SharedParamTag<Trans::Transpose, Trans::NoTranspose, BatchLayout::Right> param_tag_type;
143
144 test_batched_gemm<TestDevice, float, float, param_tag_type>();
145 }
146 TEST_F(TestCategory, batched_scalar_batched_gemm_nt_t_float_float_right) {
147 typedef ::Test::SharedParamTag<Trans::NoTranspose, Trans::Transpose, BatchLayout::Right> param_tag_type;
148
149 test_batched_gemm<TestDevice, float, float, param_tag_type>();
150 }
151 TEST_F(TestCategory, batched_scalar_batched_gemm_t_t_float_float_right) {
152 typedef ::Test::SharedParamTag<Trans::Transpose, Trans::Transpose, BatchLayout::Right> param_tag_type;
153
154 test_batched_gemm<TestDevice, float, float, param_tag_type>();
155 }
156 #endif
157
158 #if defined(KOKKOSKERNELS_INST_DOUBLE)
159 /********************* BatchLayout::Left *********************/
160 TEST_F(TestCategory, batched_scalar_batched_gemm_nt_nt_double_double_left) {
161 using param_tag_type = ::Test::SharedParamTag<Trans::NoTranspose, Trans::NoTranspose, BatchLayout::Left>;
162
163 test_batched_gemm<TestDevice, double, double, param_tag_type>();
164 }
165 TEST_F(TestCategory, batched_scalar_batched_gemm_t_nt_double_double_left) {
166 typedef ::Test::SharedParamTag<Trans::Transpose, Trans::NoTranspose, BatchLayout::Left> param_tag_type;
167
168 test_batched_gemm<TestDevice, double, double, param_tag_type>();
169 }
170 TEST_F(TestCategory, batched_scalar_batched_gemm_nt_t_double_double_left) {
171 typedef ::Test::SharedParamTag<Trans::NoTranspose, Trans::Transpose, BatchLayout::Left> param_tag_type;
172
173 test_batched_gemm<TestDevice, double, double, param_tag_type>();
174 }
175 TEST_F(TestCategory, batched_scalar_batched_gemm_t_t_double_double_left) {
176 typedef ::Test::SharedParamTag<Trans::Transpose, Trans::Transpose, BatchLayout::Left> param_tag_type;
177
178 test_batched_gemm<TestDevice, double, double, param_tag_type>();
179 }
180 /********************* BatchLayout::Right *********************/
181 TEST_F(TestCategory, batched_scalar_batched_gemm_nt_nt_double_double_right) {
182 typedef ::Test::SharedParamTag<Trans::NoTranspose, Trans::NoTranspose, BatchLayout::Right> param_tag_type;
183
184 test_batched_gemm<TestDevice, double, double, param_tag_type>();
185 }
186 TEST_F(TestCategory, batched_scalar_batched_gemm_t_nt_double_double_right) {
187 typedef ::Test::SharedParamTag<Trans::Transpose, Trans::NoTranspose, BatchLayout::Right> param_tag_type;
188
189 test_batched_gemm<TestDevice, double, double, param_tag_type>();
190 }
191 TEST_F(TestCategory, batched_scalar_batched_gemm_nt_t_double_double_right) {
192 typedef ::Test::SharedParamTag<Trans::NoTranspose, Trans::Transpose, BatchLayout::Right> param_tag_type;
193
194 test_batched_gemm<TestDevice, double, double, param_tag_type>();
195 }
196 TEST_F(TestCategory, batched_scalar_batched_gemm_t_t_double_double_right) {
197 typedef ::Test::SharedParamTag<Trans::Transpose, Trans::Transpose, BatchLayout::Right> param_tag_type;
198
199 test_batched_gemm<TestDevice, double, double, param_tag_type>();
200 }
201 #endif