Publishing 2019 R1 content
[platform/upstream/dldt.git] / inference-engine / thirdparty / mkl-dnn / tests / gtests / test_reorder.cpp
1 /*******************************************************************************
2 * Copyright 2016-2018 Intel Corporation
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *     http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 *******************************************************************************/
16
17 #include <utility>
18 #include <numeric>
19
20 #include "gtest/gtest.h"
21 #include "mkldnn_test_common.hpp"
22
23 #include "mkldnn.hpp"
24
25 namespace mkldnn {
26
27 template <typename data_i_t, typename data_o_t>
28 inline void check_reorder(const memory::desc &md_i, const memory::desc &md_o,
29         const data_i_t *src, const data_o_t *dst)
30 {
31     const int ndims = md_i.data.ndims;
32     const ptrdiff_t *dims = md_i.data.dims;
33     const size_t nelems = std::accumulate(
34             dims, dims + ndims, size_t(1), std::multiplies<size_t>());
35
36     for (size_t i = 0; i < nelems; ++i) {
37         data_i_t s_raw = src[map_index(md_i, i, false)];
38         data_o_t s = static_cast<data_o_t>(s_raw);
39         data_o_t d = dst[map_index(md_o, i, false)];
40         ASSERT_EQ(s, d) << "mismatch at position " << i;
41     }
42 }
43
44 template <typename reorder_types>
45 struct test_simple_params {
46     engine::kind engine_kind;
47     memory::format fmt_i;
48     memory::format fmt_o;
49     memory::dims dims;
50     bool expect_to_fail;
51     mkldnn_status_t expected_status;
52 };
53
54 template <typename reorder_types>
55 class reorder_simple_test:
56     public ::testing::TestWithParam<test_simple_params<reorder_types>>
57 {
58 protected:
59     virtual void SetUp() {
60         test_simple_params<reorder_types> p
61             = ::testing::TestWithParam<decltype(p)>::GetParam();
62         catch_expected_failures([=](){Test();}, p.expect_to_fail,
63                     p.expected_status);
64     }
65
66     void Test() {
67         using data_i_t = typename reorder_types::first_type;
68         using data_o_t = typename reorder_types::second_type;
69
70         test_simple_params<reorder_types> p
71             = ::testing::TestWithParam<decltype(p)>::GetParam();
72
73         ASSERT_TRUE(p.engine_kind == engine::kind::cpu);
74         auto eng = engine(p.engine_kind, 0);
75
76         const size_t nelems = std::accumulate(p.dims.begin(), p.dims.end(),
77                 size_t(1), std::multiplies<size_t>());
78
79         memory::data_type prec_i = data_traits<data_i_t>::data_type;
80         memory::data_type prec_o = data_traits<data_o_t>::data_type;
81         auto mpd_i = memory::primitive_desc({p.dims, prec_i, p.fmt_i},
82                 eng);
83         auto mpd_o = memory::primitive_desc({p.dims, prec_o, p.fmt_o},
84                 eng);
85
86         auto src_data = new data_i_t[mpd_i.get_size()];
87         auto dst_data = new data_o_t[mpd_o.get_size()];
88
89         /* initialize input data */
90         for (size_t i = 0; i < nelems; ++i)
91             src_data[map_index(mpd_i.desc(), i, false)] = data_i_t(i);
92
93         auto src = memory(mpd_i, src_data);
94         auto dst = memory(mpd_o, dst_data);
95
96         auto r = reorder(src, dst);
97         stream(stream::kind::lazy).submit({r}).wait();
98
99         check_reorder(mpd_i.desc(), mpd_o.desc(), src_data, dst_data);
100         check_zero_tail<data_o_t>(0, dst);
101
102         delete[] src_data;
103         delete[] dst_data;
104     }
105 };
106
107 using f32_f32 = std::pair<float, float>;
108 using s32_s32 = std::pair<int32_t, int32_t>;
109 using s16_s16 = std::pair<int16_t, int16_t>;
110 using s8_s8 = std::pair<int8_t, int8_t>;
111
112 using reorder_simple_corner_cases_f32_f32 = reorder_simple_test<f32_f32>;
113 using reorder_padded_test_data_f32_f32 = reorder_simple_test<f32_f32>;
114 using reorder_padded_test_weights_f32_f32 = reorder_simple_test<f32_f32>;
115 using reorder_3d_test_data_f32_f32 = reorder_simple_test<f32_f32>;
116 using reorder_3d_test_weights_f32_f32 = reorder_simple_test<f32_f32>;
117 using reorder_simple_test_data_f32_f32 = reorder_simple_test<f32_f32>;
118 using reorder_simple_test_weights_f32_f32_0 = reorder_simple_test<f32_f32>;
119 using reorder_simple_test_weights_f32_f32_1 = reorder_simple_test<f32_f32>;
120 using reorder_simple_test_weights_f32_f32_IOhw16o16i = reorder_simple_test<f32_f32>;
121 using reorder_simple_test_s32_s32 = reorder_simple_test<s32_s32>;
122 using reorder_simple_test_s16_s16 = reorder_simple_test<s16_s16>;
123 using reorder_simple_test_s8_s8 = reorder_simple_test<s8_s8>;
124
125 using eng = engine::kind;
126 using fmt = memory::format;
127
128 using test_simple_params_s32_s32 = test_simple_params<s32_s32>;
129 using test_simple_params_f32_f32 = test_simple_params<f32_f32>;
130 using test_simple_params_s16_s16 = test_simple_params<s16_s16>;
131 using test_simple_params_s8_s8 = test_simple_params<s8_s8>;
132
133 using cfg_f32= test_simple_params_f32_f32;
134 using cfg_s32= test_simple_params_s32_s32;
135 using cfg_s16= test_simple_params_s16_s16;
136 using cfg_s8= test_simple_params_s8_s8;
137
138 TEST_P(reorder_simple_corner_cases_f32_f32, TestsReorder) { }
139 INSTANTIATE_TEST_CASE_P(TestReorder, reorder_simple_corner_cases_f32_f32,
140         ::testing::Values(
141             cfg_f32{eng::cpu, fmt::nchw, fmt::nc, {2, 16, 8, 8}, true, mkldnn_invalid_arguments},
142             cfg_f32{eng::cpu, fmt::nchw, fmt::nchw, {0, 16, 8, 8}},
143             cfg_f32{eng::cpu, fmt::nchw, fmt::nChw8c, {0, 5, 8, 8}},
144             cfg_f32{eng::cpu, fmt::nchw, fmt::nChw16c, {0, 5, 8, 8}},
145             cfg_f32{eng::cpu, fmt::OIhw8o8i, fmt::oihw, {13, 0, 3, 3}},
146             cfg_f32{eng::cpu, fmt::OIhw8i8o, fmt::OIhw8o8i, {0, 32, 3, 3}},
147             cfg_f32{eng::cpu, fmt::OIhw16o16i, fmt::oihw, {16, 31, 0, 3}},
148             cfg_f32{eng::cpu, fmt::OIhw16i16o, fmt::OIhw16o16i, {32, 16, 3, 0}}
149             )
150         );
151
152 TEST_P(reorder_padded_test_data_f32_f32, TestsReorder) { }
153 INSTANTIATE_TEST_CASE_P(TestReorder, reorder_padded_test_data_f32_f32,
154         ::testing::Values(
155             cfg_f32{eng::cpu, fmt::nchw, fmt::nChw8c, {2, 28, 3, 4}},
156             cfg_f32{eng::cpu, fmt::nChw8c, fmt::nchw, {2, 28, 3, 4}},
157             cfg_f32{eng::cpu, fmt::chwn, fmt::nChw8c, {2, 28, 3, 4}},
158             cfg_f32{eng::cpu, fmt::nChw8c, fmt::chwn, {2, 28, 3, 4}},
159             cfg_f32{eng::cpu, fmt::nhwc, fmt::nChw8c, {3, 28, 3, 4}},
160             cfg_f32{eng::cpu, fmt::nChw8c, fmt::nhwc, {3, 28, 3, 4}},
161
162             cfg_f32{eng::cpu, fmt::nchw, fmt::nChw16c, {2, 28, 3, 4}},
163             cfg_f32{eng::cpu, fmt::nChw16c, fmt::nchw, {2, 28, 3, 4}},
164             cfg_f32{eng::cpu, fmt::chwn, fmt::nChw16c, {2, 28, 3, 4}},
165             cfg_f32{eng::cpu, fmt::nChw16c, fmt::chwn, {2, 28, 3, 4}},
166             cfg_f32{eng::cpu, fmt::nhwc, fmt::nChw16c, {3, 28, 3, 4}},
167             cfg_f32{eng::cpu, fmt::nChw16c, fmt::nhwc, {3, 28, 3, 4}},
168
169             cfg_f32{eng::cpu, fmt::ncdhw, fmt::nCdhw16c, {2, 28, 2, 3, 4}},
170             cfg_f32{eng::cpu, fmt::nCdhw16c, fmt::ncdhw, {2, 28, 2, 3, 4}},
171             // cfg_f32{eng::cpu, fmt::cdhwn, fmt::nCdhw16c, {2, 28, 2, 3, 4}},
172             // cfg_f32{eng::cpu, fmt::nCdhw16c, fmt::cdhwn, {2, 28, 2, 3, 4}},
173             cfg_f32{eng::cpu, fmt::ndhwc, fmt::nCdhw16c, {3, 28, 2, 3, 4}},
174             cfg_f32{eng::cpu, fmt::nCdhw16c, fmt::ndhwc, {3, 28, 2, 3, 4}}
175             )
176         );
177
178 TEST_P(reorder_3d_test_data_f32_f32, TestsReorder) { }
179 INSTANTIATE_TEST_CASE_P(TestReorder, reorder_3d_test_data_f32_f32,
180         ::testing::Values(
181             cfg_f32{eng::cpu, fmt::ncdhw, fmt::nCdhw16c, {2, 32, 2, 3, 4}},
182             cfg_f32{eng::cpu, fmt::nCdhw16c, fmt::ncdhw, {2, 32, 2, 3, 4}},
183             cfg_f32{eng::cpu, fmt::nCdhw8c, fmt::ncdhw, {2, 32, 2, 3, 4}},
184             cfg_f32{eng::cpu, fmt::ndhwc, fmt::nCdhw16c, {3, 32, 2, 3, 4}},
185             cfg_f32{eng::cpu, fmt::nCdhw16c, fmt::ndhwc, {3, 32, 2, 3, 4}},
186             cfg_f32{eng::cpu, fmt::ndhwc, fmt::nCdhw8c, {3, 32, 2, 3, 4}},
187             cfg_f32{eng::cpu, fmt::nCdhw8c, fmt::ndhwc, {3, 32, 2, 3, 4}}
188             )
189         );
190
191 TEST_P(reorder_padded_test_weights_f32_f32, TestsReorder) { }
192 INSTANTIATE_TEST_CASE_P(TestReorder, reorder_padded_test_weights_f32_f32,
193         ::testing::Values(
194             // Oi(d)hw16o
195             cfg_f32{eng::cpu, fmt::oihw, fmt::Oihw16o, {17, 23, 2, 3}},
196             cfg_f32{eng::cpu, fmt::Oihw16o, fmt::oihw, {17, 23, 2, 3}},
197             cfg_f32{eng::cpu, fmt::oidhw, fmt::Oidhw16o, {17, 23, 2, 2, 3}},
198             cfg_f32{eng::cpu, fmt::Oidhw16o, fmt::oidhw, {17, 23, 2, 2, 3}},
199             // OIhw16i16o
200             cfg_f32{eng::cpu, fmt::oihw, fmt::OIhw16i16o, {17, 23, 2, 3}},
201             cfg_f32{eng::cpu, fmt::OIhw16i16o, fmt::oihw, {17, 23, 2, 3}},
202             cfg_f32{eng::cpu, fmt::oihw, fmt::OIhw16o16i, {17, 23, 2, 3}},
203             cfg_f32{eng::cpu, fmt::OIhw16o16i, fmt::oihw, {17, 23, 2, 3}},
204             cfg_f32{eng::cpu, fmt::hwio, fmt::OIhw16i16o, {17, 23, 2, 3}},
205             cfg_f32{eng::cpu, fmt::OIhw16i16o, fmt::hwio, {17, 23, 2, 3}},
206             // OIdhw16o16i
207             cfg_f32{eng::cpu, fmt::oihw, fmt::OIhw16o16i, {17, 23, 2, 3}},
208             cfg_f32{eng::cpu, fmt::OIhw16o16i, fmt::oihw, {17, 23, 2, 3}},
209             // IOdhw16o16i
210             cfg_f32{eng::cpu, fmt::oihw, fmt::IOhw16o16i, {17, 23, 2, 3}},
211             cfg_f32{eng::cpu, fmt::IOhw16o16i, fmt::oihw, {17, 23, 2, 3}},
212             // gOdhwi16o
213             cfg_f32{eng::cpu, fmt::goidhw, fmt::gOdhwi16o, {2, 17, 23, 2, 2, 3}},
214             cfg_f32{eng::cpu, fmt::gOdhwi16o, fmt::goidhw, {2, 17, 23, 3, 2, 3}},
215             // gOIdhw16i16o
216             cfg_f32{eng::cpu, fmt::goidhw, fmt::gOIdhw16i16o, {2, 17, 23, 2, 2, 3}},
217             cfg_f32{eng::cpu, fmt::gOIdhw16i16o, fmt::goidhw, {2, 17, 23, 3, 2, 3}},
218             // gOIdhw16o16i
219             cfg_f32{eng::cpu, fmt::goidhw, fmt::gOIdhw16o16i, {2, 17, 23, 2, 2, 3}},
220             cfg_f32{eng::cpu, fmt::gOIdhw16o16i, fmt::goidhw, {2, 17, 23, 3, 2, 3}},
221             // Oihw16o
222             cfg_f32{eng::cpu, fmt::oihw, fmt::Oihw16o, {17, 23, 2, 3}},
223             cfg_f32{eng::cpu, fmt::Oihw16o, fmt::oihw, {17, 23, 2, 3}},
224             // OIhw8i8o
225             cfg_f32{eng::cpu, fmt::oihw, fmt::OIhw8i8o, {17, 23, 2, 3}},
226             cfg_f32{eng::cpu, fmt::OIhw8i8o, fmt::oihw, {17, 23, 2, 3}},
227             cfg_f32{eng::cpu, fmt::oihw, fmt::OIhw8o8i, {17, 23, 2, 3}},
228             cfg_f32{eng::cpu, fmt::OIhw8o8i, fmt::oihw, {17, 23, 2, 3}},
229             cfg_f32{eng::cpu, fmt::hwio, fmt::OIhw8i8o, {17, 23, 2, 3}},
230             cfg_f32{eng::cpu, fmt::OIhw8i8o, fmt::hwio, {17, 23, 2, 3}}
231 ));
232
233 TEST_P(reorder_3d_test_weights_f32_f32, TestsReorder) { }
234 INSTANTIATE_TEST_CASE_P(TestReorder, reorder_3d_test_weights_f32_f32,
235         ::testing::Values(
236             cfg_f32{eng::cpu, fmt::oidhw, fmt::OIdhw8i8o, {16, 24, 2, 3, 3}},
237             cfg_f32{eng::cpu, fmt::OIdhw8i8o, fmt::oidhw, {16, 24, 2, 3, 3}},
238             cfg_f32{eng::cpu, fmt::oidhw, fmt::OIdhw8o8i, {16, 24, 2, 3, 3}},
239             cfg_f32{eng::cpu, fmt::OIdhw8o8i, fmt::oidhw, {16, 24, 2, 3, 3}},
240             cfg_f32{eng::cpu, fmt::dhwio, fmt::OIdhw8i8o, {16, 24, 2, 3, 3}},
241             cfg_f32{eng::cpu, fmt::OIdhw8i8o, fmt::dhwio, {16, 24, 2, 3, 3}},
242             cfg_f32{eng::cpu, fmt::goidhw, fmt::gOdhwi8o, {2, 16, 24, 2, 2, 3}},
243             cfg_f32{eng::cpu, fmt::gOdhwi8o, fmt::goidhw, {2, 16, 24, 3, 2, 3}},
244             cfg_f32{eng::cpu, fmt::goidhw, fmt::gOIdhw8i8o, {2, 16, 24, 2, 2, 3}},
245             cfg_f32{eng::cpu, fmt::gOIdhw8i8o, fmt::goidhw, {2, 16, 24, 3, 2, 3}},
246             cfg_f32{eng::cpu, fmt::goidhw, fmt::gOIdhw8o8i, {2, 16, 24, 2, 2, 3}},
247             cfg_f32{eng::cpu, fmt::gOIdhw8o8i, fmt::goidhw, {2, 16, 24, 3, 2, 3}}
248 ));
249
250 TEST_P(reorder_simple_test_data_f32_f32, TestsReorder) { }
251 INSTANTIATE_TEST_CASE_P(TestReorder, reorder_simple_test_data_f32_f32,
252         ::testing::Values(
253             cfg_f32{eng::cpu, fmt::nchw, fmt::nchw, {10, 10, 13, 13}},
254             cfg_f32{eng::cpu, fmt::nchw, fmt::nhwc, {10, 10, 10, 10}},
255             cfg_f32{eng::cpu, fmt::nhwc, fmt::nchw, {10, 10, 10, 10}},
256             cfg_f32{eng::cpu, fmt::nchw, fmt::chwn, {28, 3, 10, 10}},
257             cfg_f32{eng::cpu, fmt::chwn, fmt::nchw, {28, 3, 10, 10}},
258             cfg_f32{eng::cpu, fmt::nhwc, fmt::nhwc, {10, 10, 13, 13}},
259             cfg_f32{eng::cpu, fmt::nchw, fmt::nChw8c, {2, 32, 4, 4}},
260             cfg_f32{eng::cpu, fmt::nChw8c, fmt::nchw, {2, 32, 4, 4}},
261             cfg_f32{eng::cpu, fmt::chwn, fmt::nChw8c, {28, 96, 10, 10}},
262             cfg_f32{eng::cpu, fmt::nChw8c, fmt::chwn, {28, 96, 10, 10}},
263             cfg_f32{eng::cpu, fmt::nhwc, fmt::nChw8c, {3, 64, 16, 16}},
264             cfg_f32{eng::cpu, fmt::nChw8c, fmt::nhwc, {3, 64, 16, 16}},
265             cfg_f32{eng::cpu, fmt::nChw8c, fmt::nChw16c, {10, 96, 27, 27}},
266             cfg_f32{eng::cpu, fmt::nChw16c, fmt::nChw8c, {10, 96, 27, 27}},
267             cfg_f32{eng::cpu, fmt::nchw, fmt::nChw16c, {2, 64, 4, 4}},
268             cfg_f32{eng::cpu, fmt::nChw16c, fmt::nchw, {2, 64, 4, 4}},
269             cfg_f32{eng::cpu, fmt::chwn, fmt::nChw16c, {28, 96, 10, 10}},
270             cfg_f32{eng::cpu, fmt::nChw16c, fmt::chwn, {28, 96, 10, 10}},
271             cfg_f32{eng::cpu, fmt::nhwc, fmt::nChw16c, {2, 64, 4, 4}},
272             cfg_f32{eng::cpu, fmt::nChw16c, fmt::nhwc, {2, 64, 4, 4}}
273             )
274         );
275
276 TEST_P(reorder_simple_test_weights_f32_f32_0, TestsReorder) { }
277 INSTANTIATE_TEST_CASE_P(TestReorder, reorder_simple_test_weights_f32_f32_0,
278         ::testing::Values(
279             cfg_f32{eng::cpu, fmt::hwio, fmt::oihw, {32, 32, 3, 3}},
280             cfg_f32{eng::cpu, fmt::oihw, fmt::hwio, {32, 32, 3, 3}},
281             cfg_f32{eng::cpu, fmt::hwio, fmt::Ohwi8o, {32, 32, 3, 3}},
282             cfg_f32{eng::cpu, fmt::Ohwi8o, fmt::hwio, {32, 32, 3, 3}},
283             cfg_f32{eng::cpu, fmt::hwio, fmt::Ohwi16o, {64, 64, 3, 3}},
284             cfg_f32{eng::cpu, fmt::Ohwi16o, fmt::hwio, {64, 64, 3, 3}},
285             cfg_f32{eng::cpu, fmt::oihw, fmt::OIhw8i8o, {32, 32, 3, 3}},
286             cfg_f32{eng::cpu, fmt::OIhw8i8o, fmt::oihw, {32, 32, 3, 3}},
287             cfg_f32{eng::cpu, fmt::ihwo, fmt::OIhw8i8o, {32, 32, 3, 3}},
288             cfg_f32{eng::cpu, fmt::OIhw8i8o, fmt::ihwo, {32, 32, 3, 3}},
289             cfg_f32{eng::cpu, fmt::oihw, fmt::OIhw8o8i, {32, 32, 3, 3}},
290             cfg_f32{eng::cpu, fmt::OIhw8o8i, fmt::oihw, {32, 32, 3, 3}},
291             cfg_f32{eng::cpu, fmt::OIhw8i8o, fmt::OIhw8o8i, {32, 32, 3, 3}},
292             cfg_f32{eng::cpu, fmt::OIhw8o8i, fmt::OIhw8i8o, {32, 32, 3, 3}},
293             cfg_f32{eng::cpu, fmt::hwio, fmt::OIhw8i8o, {32, 32, 3, 3}},
294             cfg_f32{eng::cpu, fmt::OIhw8i8o, fmt::hwio, {32, 32, 3, 3}},
295             cfg_f32{eng::cpu, fmt::goihw, fmt::hwigo, {2, 32, 32, 3, 3}},
296             cfg_f32{eng::cpu, fmt::hwigo, fmt::goihw, {2, 32, 32, 3, 3}},
297             cfg_f32{eng::cpu, fmt::goihw, fmt::gOIhw8i8o, {2, 32, 32, 3, 3}},
298             cfg_f32{eng::cpu, fmt::gOIhw8i8o, fmt::goihw, {2, 32, 32, 3, 3}},
299             cfg_f32{eng::cpu, fmt::goihw, fmt::gOIhw8o8i, {2, 32, 32, 3, 3}},
300             cfg_f32{eng::cpu, fmt::gOIhw8o8i, fmt::goihw, {2, 32, 32, 3, 3}},
301             cfg_f32{eng::cpu, fmt::gOIhw8i8o, fmt::gOIhw8o8i, {2, 32, 32, 3, 3}},
302             cfg_f32{eng::cpu, fmt::gOIhw8o8i, fmt::gOIhw8i8o, {2, 32, 32, 3, 3}},
303             cfg_f32{eng::cpu, fmt::oihw, fmt::OIhw16i16o, {64, 64, 3, 3}},
304             cfg_f32{eng::cpu, fmt::OIhw16i16o, fmt::oihw, {64, 64, 3, 3}},
305             cfg_f32{eng::cpu, fmt::ihwo, fmt::OIhw16i16o, {64, 64, 3, 3}},
306             cfg_f32{eng::cpu, fmt::OIhw16i16o, fmt::ihwo, {64, 64, 3, 3}},
307             cfg_f32{eng::cpu, fmt::oihw, fmt::OIhw16o16i, {64, 64, 3, 3}},
308             cfg_f32{eng::cpu, fmt::OIhw16o16i, fmt::oihw, {64, 64, 3, 3}},
309             cfg_f32{eng::cpu, fmt::hwio, fmt::OIhw16i16o, {64, 64, 3, 3}},
310             cfg_f32{eng::cpu, fmt::OIhw16i16o, fmt::hwio, {64, 64, 3, 3}},
311             cfg_f32{eng::cpu, fmt::goihw, fmt::gOIhw16i16o, {2, 64, 64, 3, 3}},
312             cfg_f32{eng::cpu, fmt::gOIhw16i16o, fmt::goihw, {2, 64, 64, 3, 3}},
313             cfg_f32{eng::cpu, fmt::goihw, fmt::gOIhw16o16i, {2, 64, 64, 3, 3}},
314             cfg_f32{eng::cpu, fmt::gOIhw16o16i, fmt::goihw, {2, 64, 64, 3, 3}},
315             cfg_f32{eng::cpu, fmt::OIhw16i16o, fmt::OIhw16o16i, {64, 64, 3, 3}},
316             cfg_f32{eng::cpu, fmt::OIhw16o16i, fmt::OIhw16i16o, {64, 64, 3, 3}},
317             cfg_f32{eng::cpu, fmt::gOIhw16i16o, fmt::gOIhw16o16i, {2, 64, 64, 3, 3}},
318             cfg_f32{eng::cpu, fmt::gOIhw16o16i, fmt::gOIhw16i16o, {2, 64, 64, 3, 3}},
319             cfg_f32{eng::cpu, fmt::oihw, fmt::Oihw16o, {64, 64, 3, 3}},
320             cfg_f32{eng::cpu, fmt::Oihw16o, fmt::oihw, {64, 64, 3, 3}},
321             cfg_f32{eng::cpu, fmt::goihw, fmt::gOihw16o, {2, 64, 64, 3, 3}},
322             cfg_f32{eng::cpu, fmt::gOihw16o, fmt::goihw, {2, 64, 64, 3, 3}},
323             cfg_f32{eng::cpu, fmt::Ohwi16o, fmt::Oihw16o, {64, 64, 3, 3}},
324             cfg_f32{eng::cpu, fmt::Oihw16o, fmt::Ohwi16o, {64, 64, 3, 3}},
325             cfg_f32{eng::cpu, fmt::gOhwi16o, fmt::gOihw16o, {2, 64, 64, 3, 3}},
326             cfg_f32{eng::cpu, fmt::gOihw16o, fmt::gOhwi16o, {2, 64, 64, 3, 3}},
327             cfg_f32{eng::cpu, fmt::goihw, fmt::Goihw8g, {16, 16, 16, 3, 3}},
328             cfg_f32{eng::cpu, fmt::Goihw8g, fmt::goihw, {16, 16, 16, 3, 3}}
329             )
330         );
331
332 TEST_P(reorder_simple_test_weights_f32_f32_1, TestsReorder) { }
333 INSTANTIATE_TEST_CASE_P(TestReorder, reorder_simple_test_weights_f32_f32_1,
334         ::testing::Values(
335             cfg_f32{eng::cpu, fmt::goihw, fmt::Goihw16g, {32, 32, 32, 3, 3}},
336             cfg_f32{eng::cpu, fmt::Goihw16g, fmt::goihw, {32, 32, 32, 3, 3}},
337             cfg_f32{eng::cpu, fmt::oihw, fmt::iohw, {32, 32, 3, 3}},
338             cfg_f32{eng::cpu, fmt::iohw, fmt::oihw, {32, 32, 3, 3}},
339             cfg_f32{eng::cpu, fmt::goihw, fmt::giohw, {2, 32, 32, 3, 3}},
340             cfg_f32{eng::cpu, fmt::giohw, fmt::goihw, {2, 32, 32, 3, 3}}
341             )
342         );
343
344 TEST_P(reorder_simple_test_weights_f32_f32_IOhw16o16i, TestsReorder) { }
345 INSTANTIATE_TEST_CASE_P(TestReorder, reorder_simple_test_weights_f32_f32_IOhw16o16i,
346         ::testing::Values(
347             cfg_f32{eng::cpu, fmt::oihw, fmt::IOhw16o16i, {64, 64, 3, 3}},
348             cfg_f32{eng::cpu, fmt::IOhw16o16i, fmt::oihw, {64, 64, 3, 3}},
349             cfg_f32{eng::cpu, fmt::OIhw16i16o, fmt::IOhw16o16i, {64, 64, 3, 3}},
350             cfg_f32{eng::cpu, fmt::IOhw16o16i, fmt::OIhw16i16o, {64, 64, 3, 3}},
351             cfg_f32{eng::cpu, fmt::goihw, fmt::gOIhw16o16i, {2, 64, 64, 3, 3}},
352             cfg_f32{eng::cpu, fmt::gIOhw16o16i, fmt::goihw, {2, 64, 64, 3, 3}},
353             cfg_f32{eng::cpu, fmt::gOIhw16i16o, fmt::gIOhw16o16i, {2, 64, 64, 3, 3}},
354             cfg_f32{eng::cpu, fmt::gIOhw16o16i, fmt::gOIhw16i16o, {2, 64, 64, 3, 3}}
355             )
356         );
357
358
359 TEST_P(reorder_simple_test_s32_s32, TestsReorder) { }
360 INSTANTIATE_TEST_CASE_P(TestReorder, reorder_simple_test_s32_s32,
361         ::testing::Values(
362             cfg_s32{eng::cpu, fmt::nchw, fmt::nChw16c, {2, 64, 4, 4}},
363             cfg_s32{eng::cpu, fmt::nChw16c, fmt::nchw, {2, 64, 4, 4}}
364             )
365         );
366
367 TEST_P(reorder_simple_test_s16_s16, TestsReorder) { }
368 INSTANTIATE_TEST_CASE_P(TestReorder, reorder_simple_test_s16_s16,
369         ::testing::Values(
370             cfg_s16{eng::cpu, fmt::oihw, fmt::OIhw8i16o2i, {64, 64, 3, 3}},
371             cfg_s16{eng::cpu, fmt::OIhw8i16o2i, fmt::oihw, {64, 64, 3, 3}},
372             cfg_s16{eng::cpu, fmt::goihw, fmt::gOIhw8i16o2i, {2, 64, 64, 3, 3}},
373             cfg_s16{eng::cpu, fmt::gOIhw8i16o2i, fmt::goihw, {2, 64, 64, 3, 3}},
374             cfg_s16{eng::cpu, fmt::OIhw8i16o2i, fmt::OIhw8o16i2o, {64, 64, 3, 3}},
375             cfg_s16{eng::cpu, fmt::OIhw8o16i2o, fmt::OIhw8i16o2i, {64, 64, 3, 3}},
376             cfg_s16{eng::cpu, fmt::gOIhw8i16o2i, fmt::gOIhw8o16i2o, {2, 64, 64, 3, 3}},
377             cfg_s16{eng::cpu, fmt::gOIhw8o16i2o, fmt::gOIhw8i16o2i, {2, 64, 64, 3, 3}}
378             )
379         );
380
381 TEST_P(reorder_simple_test_s8_s8, TestsReorder) { }
382 INSTANTIATE_TEST_CASE_P(TestReorder, reorder_simple_test_s8_s8,
383         ::testing::Values(
384             cfg_s8{eng::cpu, fmt::oihw, fmt::OIhw4i16o4i, {64, 64, 3, 3}},
385             cfg_s8{eng::cpu, fmt::OIhw4i16o4i, fmt::oihw, {64, 64, 3, 3}},
386             cfg_s8{eng::cpu, fmt::goihw, fmt::gOIhw4i16o4i, {2, 64, 64, 3, 3}},
387             cfg_s8{eng::cpu, fmt::gOIhw4i16o4i, fmt::goihw, {2, 64, 64, 3, 3}}
388             )
389         );
390 }