1/*******************************************************************************
2* Copyright 2016-2022 Intel Corporation
3* Copyright 2022 Arm Ltd. and affiliates
4*
5* Licensed under the Apache License, Version 2.0 (the "License");
6* you may not use this file except in compliance with the License.
7* You may obtain a copy of the License at
8*
9* http://www.apache.org/licenses/LICENSE-2.0
10*
11* Unless required by applicable law or agreed to in writing, software
12* distributed under the License is distributed on an "AS IS" BASIS,
13* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14* See the License for the specific language governing permissions and
15* limitations under the License.
16*******************************************************************************/
17#ifndef DNNL_AARCH64_USE_ACL // Ref: https://github.com/oneapi-src/oneDNN/issues/1205
18
19#include "dnnl_test_common.hpp"
20#include "gtest/gtest.h"
21
22#include "oneapi/dnnl/dnnl.hpp"
23namespace dnnl {
24
25struct test_pool_bwd_desc_t {
26 memory::dim mb, c;
27 memory::dim id, ih, iw;
28 memory::dim od, oh, ow;
29 memory::dim kd, kh, kw;
30 memory::dim dd, dh, dw;
31 memory::dim padf, padt, padl;
32 memory::dim strd, strh, strw;
33};
34
35struct pool_bwd_test_params_t {
36 algorithm aalgorithm;
37 memory::format_tag diff_src_format;
38 memory::format_tag diff_dst_format;
39 int ndims;
40 test_pool_bwd_desc_t test_pd;
41 bool expect_to_fail;
42 dnnl_status_t expected_status;
43};
44
45bool cuda_check_format_tags(memory::format_tag format) {
46 bool format_ok = format == memory::format_tag::ncdhw
47 || format == memory::format_tag::ndhwc
48 || format == memory::format_tag::nchw
49 || format == memory::format_tag::nhwc
50 || format == memory::format_tag::ncw
51 || format == memory::format_tag::nwc
52 || format == memory::format_tag::any
53 || format == memory::format_tag::nCdhw4c;
54
55 return format_ok;
56}
57
58bool hip_check_format_tags(memory::format_tag format) {
59 bool format_ok = format == memory::format_tag::nchw
60 || format == memory::format_tag::ncdhw;
61 return format_ok;
62}
63
64template <typename data_t>
65void check_pool_fwd(
66 const pool_bwd_test_params_t &p, const memory &src, const memory &dst) {
67 auto src_data = map_memory<data_t>(src);
68 auto dst_data = map_memory<data_t>(dst);
69
70 const memory::desc src_d = src.get_desc();
71 const memory::desc dst_d = dst.get_desc();
72 const dnnl::impl::memory_desc_wrapper src_mdw(src_d.get());
73 const dnnl::impl::memory_desc_wrapper dst_mdw(dst_d.get());
74
75 auto pd = p.test_pd;
76 auto padded_c = src_d.get_padded_dims()[1];
77
78 dnnl::impl::parallel_nd(pd.mb, pd.c, pd.od, pd.oh, pd.ow,
79 [&](memory::dim n, memory::dim c, memory::dim od, memory::dim oh,
80 memory::dim ow) {
81 if (is_current_test_failed()) return;
82
83 memory::dim oidx = n * padded_c * pd.od * pd.oh * pd.ow
84 + c * pd.od * pd.oh * pd.ow + od * pd.oh * pd.ow
85 + oh * pd.ow + ow;
86 data_t out = dst_data[dst_mdw.off_l(oidx, true)];
87
88 // match implementation for pooling_max: padding
89 // is done with lowest value and not zero, it
90 // affects the case when kernel slips into
91 // the padding area entirely
92 data_t out_ref = (p.aalgorithm == algorithm::pooling_max)
93 ? std::numeric_limits<data_t>::lowest()
94 : data_t(0);
95 bool is_initialized = false;
96 int num_summands = 0;
97
98 for_(memory::dim kd = 0; kd < pd.kd; ++kd)
99 for_(memory::dim kh = 0; kh < pd.kh; ++kh)
100 for (memory::dim kw = 0; kw < pd.kw; ++kw) {
101 const memory::dim id
102 = od * pd.strd - pd.padf + kd * (pd.dd + 1);
103 const memory::dim ih
104 = oh * pd.strh - pd.padt + kh * (pd.dh + 1);
105 const memory::dim iw
106 = ow * pd.strw - pd.padl + kw * (pd.dw + 1);
107
108 if (id < 0 || id >= pd.id) continue;
109 if (ih < 0 || ih >= pd.ih) continue;
110 if (iw < 0 || iw >= pd.iw) continue;
111
112 size_t iidx = (size_t)n * padded_c * pd.id * pd.ih * pd.iw
113 + (size_t)c * pd.id * pd.ih * pd.iw
114 + (size_t)id * pd.ih * pd.iw + (size_t)ih * pd.iw
115 + iw;
116
117 data_t d = src_data[src_mdw.off_l(iidx, true)];
118 if (p.aalgorithm == algorithm::pooling_max) {
119 if (!is_initialized) {
120 out_ref = d;
121 is_initialized = true;
122 } else {
123 if (out_ref < d) out_ref = d;
124 }
125 } else if (p.aalgorithm
126 == algorithm::pooling_avg_include_padding
127 || p.aalgorithm
128 == algorithm::pooling_avg_exclude_padding) {
129 out_ref += d;
130 num_summands++;
131 }
132 }
133 if (p.aalgorithm == algorithm::pooling_avg_include_padding)
134 num_summands = pd.kd * pd.kh * pd.kw;
135 if ((p.aalgorithm == algorithm::pooling_avg_include_padding
136 || p.aalgorithm
137 == algorithm::pooling_avg_exclude_padding)
138 && num_summands) {
139 out_ref /= num_summands;
140 }
141 ASSERT_NEAR(out, out_ref, 1e-6f);
142 });
143}
144
145template <typename data_t>
146void check_pool_bwd(const pool_bwd_test_params_t &p, const memory &diff_src,
147 const memory &diff_dst, const memory &ws) {
148 auto diff_src_data = map_memory<data_t>(diff_src);
149 auto diff_dst_data = map_memory<data_t>(diff_dst);
150
151 auto ws_data_ptr = map_memory<unsigned char>(ws);
152
153 auto ws_data = [&](size_t idx) -> int {
154 auto w = (const unsigned char *)ws_data_ptr;
155 if (w == nullptr) return -1;
156 if (ws.get_desc().get_data_type() == dnnl_u8)
157 return (int)w[idx];
158 else
159 return ((const int *)w)[idx];
160 };
161
162 const memory::desc diff_src_d = diff_src.get_desc();
163 const memory::desc diff_dst_d = diff_dst.get_desc();
164 const memory::desc ws_d = ws.get_desc();
165
166 const dnnl::impl::memory_desc_wrapper diff_src_mdw(diff_src_d.get());
167 const dnnl::impl::memory_desc_wrapper diff_dst_mdw(diff_dst_d.get());
168 const dnnl::impl::memory_desc_wrapper ws_mdw(ws_d.get());
169
170 auto pd = p.test_pd;
171 if (pd.mb * pd.c * pd.id * pd.ih * pd.iw == 0) return;
172
173 std::vector<data_t> ref_diff_src_vec(pd.mb * pd.c * pd.id * pd.ih * pd.iw);
174 data_t *ref_diff_src = &ref_diff_src_vec[0];
175
176 dnnl::impl::parallel_nd(pd.mb * pd.c * pd.id * pd.ih * pd.iw,
177 [&](memory::dim i) { ref_diff_src[i] = 0.; });
178
179 dnnl::impl::parallel_nd(pd.mb, pd.c, [&](memory::dim n, memory::dim c) {
180 for_(memory::dim od = 0; od < pd.od; od++)
181 for_(memory::dim oh = 0; oh < pd.oh; oh++)
182 for (memory::dim ow = 0; ow < pd.ow; ow++) {
183 memory::dim oidx = n * pd.c * pd.od * pd.oh * pd.ow
184 + c * pd.od * pd.oh * pd.ow + od * pd.oh * pd.ow
185 + oh * pd.ow + ow;
186 data_t diff_dst = diff_dst_data[diff_dst_mdw.off_l(oidx, true)];
187 for_(memory::dim kd = 0; kd < pd.kd; kd++)
188 for_(memory::dim kh = 0; kh < pd.kh; kh++)
189 for (memory::dim kw = 0; kw < pd.kw; kw++) {
190 memory::dim iw = ow * pd.strw - pd.padl + kw * (pd.dw + 1);
191 memory::dim ih = oh * pd.strh - pd.padt + kh * (pd.dh + 1);
192 memory::dim id = od * pd.strd - pd.padf + kd * (pd.dd + 1);
193 if (iw < 0 || iw >= pd.iw) continue;
194 if (ih < 0 || ih >= pd.ih) continue;
195 if (id < 0 || id >= pd.id) continue;
196 memory::dim iidx = n * pd.c * pd.id * pd.ih * pd.iw
197 + c * pd.id * pd.ih * pd.iw + id * pd.ih * pd.iw
198 + ih * pd.iw + iw;
199 if (p.aalgorithm == algorithm::pooling_max) {
200 memory::dim kw_max
201 = ws_data(ws_mdw.off_l(oidx, true)) % pd.kw;
202 memory::dim kh_max
203 = (ws_data(ws_mdw.off_l(oidx, true)) / pd.kw)
204 % pd.kh;
205 memory::dim kd_max
206 = (ws_data(ws_mdw.off_l(oidx, true)) / pd.kw)
207 / pd.kh;
208 if (kh == kh_max && kw == kw_max && kd == kd_max)
209 ref_diff_src[iidx] += diff_dst;
210 } else {
211 auto id_start = od * pd.strd - pd.padf;
212 auto ih_start = oh * pd.strh - pd.padt;
213 auto iw_start = ow * pd.strw - pd.padl;
214 auto id_end = od * pd.strd - pd.padf + (pd.kd - 1) * pd.dd
215 + pd.kd;
216 auto ih_end = oh * pd.strh - pd.padt + (pd.kh - 1) * pd.dh
217 + pd.kh;
218 auto iw_end = ow * pd.strw - pd.padl + (pd.kw - 1) * pd.dw
219 + pd.kw;
220
221 auto id_start_excluded = id_start < 0
222 ? (0 - id_start - 1) / (pd.dd + 1) + 1
223 : 0;
224 auto ih_start_excluded = ih_start < 0
225 ? (0 - ih_start - 1) / (pd.dh + 1) + 1
226 : 0;
227 auto iw_start_excluded = iw_start < 0
228 ? (0 - iw_start - 1) / (pd.dw + 1) + 1
229 : 0;
230 auto id_end_excluded = id_end > pd.id
231 ? (id_end - pd.id - 1) / (pd.dd + 1) + 1
232 : 0;
233 auto ih_end_excluded = ih_end > pd.ih
234 ? (ih_end - pd.ih - 1) / (pd.dh + 1) + 1
235 : 0;
236 auto iw_end_excluded = iw_end > pd.iw
237 ? (iw_end - pd.iw - 1) / (pd.dw + 1) + 1
238 : 0;
239
240 auto num_summands
241 = (p.aalgorithm
242 != algorithm::pooling_avg_exclude_padding)
243 ? pd.kw * pd.kh * pd.kd
244 : (pd.kd - id_start_excluded - id_end_excluded)
245 * (pd.kh - ih_start_excluded
246 - ih_end_excluded)
247 * (pd.kw - iw_start_excluded
248 - iw_end_excluded);
249
250 ref_diff_src[iidx] += diff_dst / num_summands;
251 }
252 }
253 }
254 });
255
256 dnnl::impl::parallel_nd(
257 pd.mb * pd.c * pd.id * pd.ih * pd.iw, [&](memory::dim i) {
258 if (is_current_test_failed()) return;
259
260 ASSERT_NEAR(ref_diff_src[i],
261 diff_src_data[diff_src_mdw.off_l(i, true)], 1e-5f);
262 });
263}
264
265template <typename data_t>
266class pooling_bwd_test_t
267 : public ::testing::TestWithParam<pool_bwd_test_params_t> {
268private:
269 std::shared_ptr<memory::desc> src_desc;
270 std::shared_ptr<memory::desc> dst_desc;
271 memory workspace;
272 pooling_forward::primitive_desc pool_prim_desc;
273 pool_bwd_test_params_t p;
274 memory::dims strides, ker, dilation, pad_l, pad_r;
275 engine eng;
276 stream strm;
277 memory::data_type data_type;
278
279protected:
280 void SetUp() override {
281 p = ::testing::TestWithParam<decltype(p)>::GetParam();
282 SKIP_IF_CUDA(!cuda_check_format_tags(p.diff_src_format),
283 "Unsupported format tag");
284 SKIP_IF_CUDA(!cuda_check_format_tags(p.diff_dst_format),
285 "Unsupported format tag");
286 // This test makes assumptions on workspace content for the max
287 // algorithm therefore it cannot be used for non-intel implementations.
288 SKIP_IF_CUDA(p.aalgorithm == algorithm::pooling_max,
289 "Test is not designed to test non-intel implementations of max "
290 "algorithm");
291
292 SKIP_IF_HIP(!hip_check_format_tags(p.diff_src_format),
293 "Unsupported format tag");
294 SKIP_IF_HIP(!hip_check_format_tags(p.diff_dst_format),
295 "Unsupported format tag");
296 // This test makes assumptions on workspace content for the max
297 // algorithm therefore it cannot be used for non-intel implementations.
298 SKIP_IF_HIP(p.aalgorithm == algorithm::pooling_max,
299 "Test is not designed to test non-intel implementations of max "
300 "algorithm");
301
302 catch_expected_failures(
303 [=]() { Test(); }, p.expect_to_fail, p.expected_status);
304 }
305
306 void Test() {
307 test_pool_bwd_desc_t pd = p.test_pd;
308
309 eng = get_test_engine();
310 strm = make_stream(eng);
311 data_type = data_traits<data_t>::data_type;
312 ASSERT_EQ(data_type, dnnl::memory::data_type::f32);
313
314 if (p.ndims == 5) {
315 auto src_dims = {pd.mb, pd.c, pd.id, pd.ih, pd.iw};
316 auto dst_dims = {pd.mb, pd.c, pd.od, pd.oh, pd.ow};
317 src_desc = std::make_shared<memory::desc>(
318 src_dims, data_type, p.diff_src_format);
319 dst_desc = std::make_shared<memory::desc>(
320 dst_dims, data_type, p.diff_dst_format);
321 } else {
322 auto src_dims = {pd.mb, pd.c, pd.ih, pd.iw};
323 auto dst_dims = {pd.mb, pd.c, pd.oh, pd.ow};
324 src_desc = std::make_shared<memory::desc>(
325 src_dims, data_type, p.diff_src_format);
326 dst_desc = std::make_shared<memory::desc>(
327 dst_dims, data_type, p.diff_dst_format);
328 }
329
330 if (p.ndims == 5) {
331 strides = memory::dims({pd.strd, pd.strh, pd.strw});
332 ker = memory::dims({pd.kd, pd.kh, pd.kw});
333 dilation = memory::dims({pd.dd, pd.dh, pd.dw});
334 pad_l = memory::dims({pd.padf, pd.padt, pd.padl});
335 pad_r = memory::dims({right_padding(pd.id, pd.od, pd.kd, pd.padf,
336 pd.strd, pd.dd),
337 right_padding(pd.ih, pd.oh, pd.kh, pd.padt, pd.strh, pd.dh),
338 right_padding(
339 pd.iw, pd.ow, pd.kw, pd.padl, pd.strw, pd.dw)});
340 } else {
341 strides = memory::dims({pd.strh, pd.strw});
342 ker = memory::dims({pd.kh, pd.kw});
343 dilation = memory::dims({pd.dh, pd.dw});
344 pad_l = memory::dims({pd.padt, pd.padl});
345 pad_r = memory::dims({right_padding(pd.ih, pd.oh, pd.kh, pd.padt,
346 pd.strh, pd.dh),
347 right_padding(
348 pd.iw, pd.ow, pd.kw, pd.padl, pd.strw, pd.dw)});
349 }
350
351 Forward();
352 Backward();
353 }
354
355 void check_prim_desc(
356 const pooling_backward::primitive_desc &pool_bwd_prim_desc) {
357 ASSERT_TRUE(pool_bwd_prim_desc.query_md(
358 query::exec_arg_md, DNNL_ARG_DIFF_SRC)
359 == pool_bwd_prim_desc.diff_src_desc());
360 ASSERT_TRUE(pool_bwd_prim_desc.query_md(
361 query::exec_arg_md, DNNL_ARG_DIFF_DST)
362 == pool_bwd_prim_desc.diff_dst_desc());
363 ASSERT_TRUE(pool_bwd_prim_desc.query_md(
364 query::exec_arg_md, DNNL_ARG_WORKSPACE)
365 == pool_bwd_prim_desc.workspace_desc());
366
367 ASSERT_EQ(pool_bwd_prim_desc.get_prop_kind(), prop_kind::backward_data);
368 ASSERT_EQ(pool_bwd_prim_desc.get_algorithm(), p.aalgorithm);
369 ASSERT_EQ(pool_bwd_prim_desc.get_kernel(), ker);
370 ASSERT_EQ(pool_bwd_prim_desc.get_strides(), strides);
371 ASSERT_EQ(pool_bwd_prim_desc.get_padding_l(), pad_l);
372 ASSERT_EQ(pool_bwd_prim_desc.get_padding_r(), pad_r);
373
374 if (p.test_pd.dd == 0 && p.test_pd.dh == 0 && p.test_pd.dw == 0)
375 ASSERT_EQ(pool_prim_desc.get_dilations(),
376 memory::dims(pool_prim_desc.src_desc().get_ndims() - 2));
377 else
378 ASSERT_EQ(pool_prim_desc.get_dilations(), dilation);
379 }
380
381 void Forward() {
382 auto src = test::make_memory(*src_desc, eng);
383 auto dst = test::make_memory(*dst_desc, eng);
384
385 fill_data<data_t>(src.get_desc().get_size() / sizeof(data_t), src);
386 fill_data<data_t>(dst.get_desc().get_size() / sizeof(data_t), dst);
387 check_zero_tail<data_t>(1, src);
388 check_zero_tail<data_t>(1, dst);
389
390 pool_prim_desc = pooling_forward::primitive_desc(eng,
391 prop_kind::forward_training, p.aalgorithm, *src_desc, *dst_desc,
392 strides, ker, dilation, pad_l, pad_r);
393
394 auto p_workspace_desc = pool_prim_desc.workspace_desc();
395 workspace = test::make_memory(p_workspace_desc, eng);
396
397 EXPECT_ANY_THROW(pooling_forward(pool_prim_desc, {}));
398 pooling_forward(pool_prim_desc)
399 .execute(strm,
400 {{DNNL_ARG_SRC, src}, {DNNL_ARG_DST, dst},
401 {DNNL_ARG_WORKSPACE, workspace}});
402
403 strm.wait();
404
405 check_zero_tail<data_t>(0, dst);
406 check_pool_fwd<data_t>(p, src, dst);
407 }
408
409 void Backward() {
410 auto diff_src = test::make_memory(*src_desc, eng);
411 auto diff_dst = test::make_memory(*dst_desc, eng);
412
413 fill_data<data_t>(
414 diff_dst.get_desc().get_size() / sizeof(data_t), diff_dst);
415 fill_data<data_t>(
416 diff_src.get_desc().get_size() / sizeof(data_t), diff_src);
417 check_zero_tail<data_t>(1, diff_dst);
418 check_zero_tail<data_t>(1, diff_src);
419
420 auto pool_bwd_prim_desc = pooling_backward::primitive_desc(eng,
421 p.aalgorithm, *src_desc, *dst_desc, strides, ker, dilation,
422 pad_l, pad_r, pool_prim_desc);
423 pool_bwd_prim_desc = pooling_backward::primitive_desc(
424 pool_bwd_prim_desc.get()); // test construction from a C pd
425 check_prim_desc(pool_bwd_prim_desc);
426
427 pooling_backward(pool_bwd_prim_desc)
428 .execute(strm,
429 {{DNNL_ARG_DIFF_DST, diff_dst},
430 {DNNL_ARG_DIFF_SRC, diff_src},
431 {DNNL_ARG_WORKSPACE, workspace}});
432 strm.wait();
433
434 check_zero_tail<data_t>(0, diff_src);
435 check_pool_bwd<data_t>(p, diff_src, diff_dst, workspace);
436 }
437};
438
439using pooling_bwd_test_float = pooling_bwd_test_t<float>;
440using pool_bwd_test_params_float = pool_bwd_test_params_t;
441
442#define EXPAND_SIZES_3D(...) \
443 5, { __VA_ARGS__ }
444#define EXPAND_SIZES_2D( \
445 mb, ic, ih, iw, oh, ow, kh, kw, dh, dw, padt, padl, strh, strw) \
446 4, { \
447 mb, ic, 1, ih, iw, 1, oh, ow, 1, kh, kw, 0, dh, dw, 0, padt, padl, 1, \
448 strh, strw \
449 }
450
451TEST_P(pooling_bwd_test_float, TestsPoolingBackward) {}
452
453INSTANTIATE_TEST_SUITE_P(TestPoolingBackwardZeroDim, pooling_bwd_test_float,
454 ::testing::Values(
455 pool_bwd_test_params_float {
456 algorithm::pooling_avg_include_padding,
457 memory::format_tag::nchw, memory::format_tag::nchw,
458 EXPAND_SIZES_2D(
459 2, 0, 4, 4, 4, 4, 3, 3, 0, 0, 1, 1, 1, 1)},
460 pool_bwd_test_params_float {algorithm::pooling_max,
461 memory::format_tag::nchw, memory::format_tag::nchw,
462 EXPAND_SIZES_2D(
463 2, 0, 4, 4, 4, 4, 3, 3, 0, 0, 1, 1, 1, 1)},
464 pool_bwd_test_params_float {algorithm::pooling_max,
465 memory::format_tag::nchw, memory::format_tag::nchw,
466 EXPAND_SIZES_2D(
467 0, 4, 4, 4, 4, 4, 3, 3, 1, 1, 1, 1, 1, 1)},
468 pool_bwd_test_params_float {algorithm::pooling_max,
469 memory::format_tag::nchw, memory::format_tag::nchw,
470 EXPAND_SIZES_2D(
471 2, 4, 0, 4, 4, 4, 3, 3, 2, 2, 1, 1, 1, 1)}));
472
473INSTANTIATE_TEST_SUITE_P(TestPoolingBackwardEF, pooling_bwd_test_float,
474 ::testing::Values(
475 pool_bwd_test_params_float {algorithm::pooling_max,
476 memory::format_tag::nchw, memory::format_tag::nchw,
477 EXPAND_SIZES_2D(
478 2, -4, 4, 4, 4, 4, 3, 3, 0, 0, 1, 1, 1, 1),
479 true, dnnl_invalid_arguments},
480 pool_bwd_test_params_float {algorithm::pooling_max,
481 memory::format_tag::nchw, memory::format_tag::nchw,
482 EXPAND_SIZES_2D(
483 -2, 4, 4, 4, 4, 4, 3, 3, 0, 0, 1, 1, 1, 1),
484 true, dnnl_invalid_arguments},
485 pool_bwd_test_params_float {algorithm::eltwise_square,
486 memory::format_tag::nchw, memory::format_tag::nchw,
487 EXPAND_SIZES_2D(
488 2, 4, 4, 4, 4, 4, 3, 3, 2, 2, 1, 1, 1, 1),
489 true, dnnl_invalid_arguments}));
490
491INSTANTIATE_TEST_SUITE_P(TestPooling_nChw16c_padded, pooling_bwd_test_float,
492 ::testing::Values(pool_bwd_test_params_float {algorithm::pooling_max,
493 memory::format_tag::nChw16c,
494 memory::format_tag::nChw16c,
495 EXPAND_SIZES_2D(4, 17, 6, 6, 7, 7, 2, 2, 0, 0,
496 1, 1, 1, 1)},
497 pool_bwd_test_params_float {
498 algorithm::pooling_avg_exclude_padding,
499 memory::format_tag::nChw16c,
500 memory::format_tag::nChw16c,
501 EXPAND_SIZES_2D(
502 4, 23, 60, 60, 31, 31, 3, 4, 1, 1, 1, 1, 2, 2)},
503 pool_bwd_test_params_float {
504 algorithm::pooling_avg_include_padding,
505 memory::format_tag::nChw16c,
506 memory::format_tag::nChw16c,
507 EXPAND_SIZES_2D(
508 4, 14, 60, 60, 31, 31, 3, 2, 2, 2, 1, 1, 2, 2)},
509 pool_bwd_test_params_float {algorithm::pooling_max,
510 memory::format_tag::nChw16c,
511 memory::format_tag::nChw16c,
512 EXPAND_SIZES_2D(
513 4, 17, 60, 60, 31, 31, 4, 3, 2, 2, 1, 1, 2, 2)},
514 pool_bwd_test_params_float {
515 algorithm::pooling_avg_exclude_padding,
516 memory::format_tag::nChw16c,
517 memory::format_tag::nChw16c,
518 EXPAND_SIZES_2D(
519 4, 14, 60, 60, 31, 31, 2, 3, 1, 1, 1, 1, 2, 2)},
520 pool_bwd_test_params_float {
521 algorithm::pooling_avg_include_padding,
522 memory::format_tag::nChw16c,
523 memory::format_tag::nChw16c,
524 EXPAND_SIZES_2D(4, 28, 60, 60, 31, 31, 4, 2, 1, 1, 1, 1,
525 2, 2)}));
526
527INSTANTIATE_TEST_SUITE_P(TestPooling_nChw8c_padded, pooling_bwd_test_float,
528 ::testing::Values(
529 pool_bwd_test_params_float {algorithm::pooling_max,
530 memory::format_tag::nChw8c, memory::format_tag::nChw8c,
531 EXPAND_SIZES_2D(
532 4, 5, 6, 6, 7, 7, 2, 2, 0, 0, 1, 1, 1, 1)},
533 pool_bwd_test_params_float {
534 algorithm::pooling_avg_exclude_padding,
535 memory::format_tag::nChw8c, memory::format_tag::nChw8c,
536 EXPAND_SIZES_2D(
537 4, 23, 60, 60, 31, 31, 3, 4, 0, 0, 1, 1, 2, 2)},
538 pool_bwd_test_params_float {
539 algorithm::pooling_avg_include_padding,
540 memory::format_tag::nChw8c, memory::format_tag::nChw8c,
541 EXPAND_SIZES_2D(
542 4, 14, 60, 60, 31, 31, 3, 2, 0, 0, 1, 1, 2, 2)},
543 pool_bwd_test_params_float {algorithm::pooling_max,
544 memory::format_tag::nChw8c, memory::format_tag::nChw8c,
545 EXPAND_SIZES_2D(
546 4, 17, 60, 60, 31, 31, 4, 3, 1, 1, 1, 1, 2, 2)},
547 pool_bwd_test_params_float {
548 algorithm::pooling_avg_exclude_padding,
549 memory::format_tag::nChw8c, memory::format_tag::nChw8c,
550 EXPAND_SIZES_2D(
551 4, 14, 60, 60, 31, 31, 2, 3, 1, 1, 1, 1, 2, 2)},
552 pool_bwd_test_params_float {
553 algorithm::pooling_avg_include_padding,
554 memory::format_tag::nChw8c, memory::format_tag::nChw8c,
555 EXPAND_SIZES_2D(4, 28, 60, 60, 31, 31, 4, 2, 1, 1, 1, 1,
556 2, 2)}));
557
558CPU_INSTANTIATE_TEST_SUITE_P(TestPoolingBackwardMaxKernelSlipsToPadding,
559 pooling_bwd_test_float,
560 ::testing::Values(
561 pool_bwd_test_params_float {algorithm::pooling_max,
562 memory::format_tag::nchw, memory::format_tag::nchw,
563 EXPAND_SIZES_2D(
564 1, 16, 10, 10, 6, 6, 5, 5, 0, 0, 10, 10, 5, 5)},
565 pool_bwd_test_params_float {algorithm::pooling_max,
566 memory::format_tag::nhwc, memory::format_tag::nhwc,
567 EXPAND_SIZES_2D(
568 1, 16, 10, 10, 6, 6, 5, 5, 0, 0, 10, 10, 5, 5)},
569 pool_bwd_test_params_float {algorithm::pooling_max,
570 memory::format_tag::nChw8c, memory::format_tag::nChw8c,
571 EXPAND_SIZES_2D(
572 1, 16, 10, 10, 6, 6, 5, 5, 0, 0, 10, 10, 5, 5)},
573 pool_bwd_test_params_float {algorithm::pooling_max,
574 memory::format_tag::nChw16c,
575 memory::format_tag::nChw16c,
576 EXPAND_SIZES_2D(1, 16, 10, 10, 6, 6, 5, 5, 0, 0, 10, 10,
577 5, 5)}));
578
579CPU_INSTANTIATE_TEST_SUITE_P(TestPooling3D_nCdhw16c, pooling_bwd_test_float,
580 ::testing::Values(pool_bwd_test_params_float {algorithm::pooling_max,
581 memory::format_tag::nCdhw16c,
582 memory::format_tag::nCdhw16c,
583 EXPAND_SIZES_3D(2, 32, 60, 60, 60, 31, 30, 30,
584 2, 3, 4, 0, 0, 0, 1, 1, 1, 2, 2, 2)},
585 pool_bwd_test_params_float {algorithm::pooling_max,
586 memory::format_tag::nCdhw16c,
587 memory::format_tag::nCdhw16c,
588 EXPAND_SIZES_3D(2, 32, 23, 23, 23, 11, 11, 11, 2, 2, 2,
589 0, 0, 0, 0, 0, 0, 2, 2, 2)},
590 pool_bwd_test_params_float {
591 algorithm::pooling_avg_exclude_padding,
592 memory::format_tag::nCdhw16c,
593 memory::format_tag::nCdhw16c,
594 EXPAND_SIZES_3D(2, 32, 60, 60, 60, 30, 30, 31, 4, 3, 2,
595 0, 0, 0, 1, 1, 1, 2, 2, 2)},
596 pool_bwd_test_params_float {
597 algorithm::pooling_avg_include_padding,
598 memory::format_tag::nCdhw16c,
599 memory::format_tag::nCdhw16c,
600 EXPAND_SIZES_3D(2, 32, 60, 60, 60, 30, 31, 30, 4, 2, 3,
601 1, 1, 1, 1, 1, 1, 2, 2, 2)},
602 pool_bwd_test_params_float {algorithm::pooling_max,
603 memory::format_tag::nCdhw16c,
604 memory::format_tag::nCdhw16c,
605 EXPAND_SIZES_3D(2, 32, 30, 30, 30, 30, 30, 30, 3, 3, 3,
606 1, 1, 1, 1, 1, 1, 1, 1, 1)},
607 pool_bwd_test_params_float {
608 algorithm::pooling_avg_exclude_padding,
609 memory::format_tag::nCdhw16c,
610 memory::format_tag::nCdhw16c,
611 EXPAND_SIZES_3D(2, 32, 30, 30, 30, 30, 30, 30, 3, 3, 3,
612 1, 1, 1, 2, 2, 2, 1, 1, 1)},
613 pool_bwd_test_params_float {
614 algorithm::pooling_avg_include_padding,
615 memory::format_tag::nCdhw16c,
616 memory::format_tag::nCdhw16c,
617 EXPAND_SIZES_3D(2, 32, 30, 30, 30, 30, 30, 30, 3, 3, 3,
618 1, 1, 1, 2, 2, 2, 1, 1, 1)}));
619
620CPU_INSTANTIATE_TEST_SUITE_P(TestPooling3D_ncdhw, pooling_bwd_test_float,
621 ::testing::Values(
622 pool_bwd_test_params_float {algorithm::pooling_max,
623 memory::format_tag::ncdhw, memory::format_tag::ncdhw,
624 EXPAND_SIZES_3D(2, 32, 60, 60, 60, 31, 30, 30, 2, 3, 4,
625 0, 0, 0, 1, 1, 1, 2, 2, 2)},
626 pool_bwd_test_params_float {
627 algorithm::pooling_avg_exclude_padding,
628 memory::format_tag::ncdhw, memory::format_tag::ncdhw,
629 EXPAND_SIZES_3D(2, 32, 60, 60, 60, 30, 30, 31, 4, 3, 2,
630 0, 0, 0, 1, 1, 1, 2, 2, 2)},
631 pool_bwd_test_params_float {
632 algorithm::pooling_avg_include_padding,
633 memory::format_tag::ncdhw, memory::format_tag::ncdhw,
634 EXPAND_SIZES_3D(2, 32, 60, 60, 60, 30, 31, 30, 4, 2, 3,
635 0, 0, 0, 1, 1, 1, 2, 2, 2)},
636 pool_bwd_test_params_float {algorithm::pooling_max,
637 memory::format_tag::ncdhw, memory::format_tag::ncdhw,
638 EXPAND_SIZES_3D(2, 32, 30, 30, 30, 30, 30, 30, 3, 3, 3,
639 1, 1, 1, 1, 1, 1, 1, 1, 1)},
640 pool_bwd_test_params_float {
641 algorithm::pooling_avg_exclude_padding,
642 memory::format_tag::ncdhw, memory::format_tag::ncdhw,
643 EXPAND_SIZES_3D(2, 32, 30, 30, 30, 30, 30, 30, 3, 3, 3,
644 1, 1, 1, 1, 1, 1, 1, 1, 1)},
645 pool_bwd_test_params_float {
646 algorithm::pooling_avg_include_padding,
647 memory::format_tag::ncdhw, memory::format_tag::ncdhw,
648 EXPAND_SIZES_3D(2, 32, 30, 30, 30, 30, 30, 30, 3, 3, 3,
649 1, 1, 1, 1, 1, 1, 1, 1, 1)}));
650
651CPU_INSTANTIATE_TEST_SUITE_P(TestPooling3D_ndhwc, pooling_bwd_test_float,
652 ::testing::Values(
653 pool_bwd_test_params_float {algorithm::pooling_max,
654 memory::format_tag::ndhwc, memory::format_tag::ndhwc,
655 EXPAND_SIZES_3D(2, 32, 60, 60, 60, 31, 30, 30, 2, 3, 4,
656 1, 1, 0, 0, 0, 1, 2, 2, 2)},
657 pool_bwd_test_params_float {
658 algorithm::pooling_avg_exclude_padding,
659 memory::format_tag::ndhwc, memory::format_tag::ndhwc,
660 EXPAND_SIZES_3D(2, 32, 60, 60, 60, 30, 30, 31, 4, 3, 2,
661 0, 0, 0, 1, 1, 1, 2, 2, 2)},
662 pool_bwd_test_params_float {
663 algorithm::pooling_avg_include_padding,
664 memory::format_tag::ndhwc, memory::format_tag::ndhwc,
665 EXPAND_SIZES_3D(2, 32, 60, 60, 60, 30, 31, 30, 4, 2, 3,
666 0, 0, 0, 1, 1, 1, 2, 2, 2)},
667 pool_bwd_test_params_float {algorithm::pooling_max,
668 memory::format_tag::ndhwc, memory::format_tag::ndhwc,
669 EXPAND_SIZES_3D(2, 32, 30, 30, 30, 30, 30, 30, 3, 3, 3,
670 0, 0, 0, 1, 1, 1, 1, 1, 1)},
671 pool_bwd_test_params_float {
672 algorithm::pooling_avg_exclude_padding,
673 memory::format_tag::ndhwc, memory::format_tag::ndhwc,
674 EXPAND_SIZES_3D(2, 32, 30, 30, 30, 30, 30, 30, 3, 3, 3,
675 2, 2, 2, 1, 1, 1, 1, 1, 1)},
676 pool_bwd_test_params_float {
677 algorithm::pooling_avg_include_padding,
678 memory::format_tag::ndhwc, memory::format_tag::ndhwc,
679 EXPAND_SIZES_3D(2, 32, 30, 30, 30, 30, 30, 30, 3, 3, 3,
680 2, 2, 2, 1, 1, 1, 1, 1, 1)}));
681
682CPU_INSTANTIATE_TEST_SUITE_P(TestPooling3D_nCdhw8c, pooling_bwd_test_float,
683 ::testing::Values(pool_bwd_test_params_float {algorithm::pooling_max,
684 memory::format_tag::nCdhw8c,
685 memory::format_tag::nCdhw8c,
686 EXPAND_SIZES_3D(2, 32, 60, 60, 60, 31, 30, 30,
687 2, 3, 4, 0, 0, 0, 1, 1, 1, 2, 2, 2)},
688 pool_bwd_test_params_float {
689 algorithm::pooling_avg_exclude_padding,
690 memory::format_tag::nCdhw8c,
691 memory::format_tag::nCdhw8c,
692 EXPAND_SIZES_3D(2, 32, 60, 60, 60, 30, 30, 31, 4, 3, 2,
693 0, 0, 0, 1, 1, 1, 2, 2, 2)},
694 pool_bwd_test_params_float {
695 algorithm::pooling_avg_include_padding,
696 memory::format_tag::nCdhw8c,
697 memory::format_tag::nCdhw8c,
698 EXPAND_SIZES_3D(2, 32, 60, 60, 60, 30, 31, 30, 4, 2, 3,
699 0, 0, 0, 1, 1, 1, 2, 2, 2)},
700 pool_bwd_test_params_float {algorithm::pooling_max,
701 memory::format_tag::nCdhw8c,
702 memory::format_tag::nCdhw8c,
703 EXPAND_SIZES_3D(2, 32, 30, 30, 30, 30, 30, 30, 3, 3, 3,
704 1, 1, 1, 1, 1, 1, 1, 1, 1)},
705 pool_bwd_test_params_float {
706 algorithm::pooling_avg_exclude_padding,
707 memory::format_tag::nCdhw8c,
708 memory::format_tag::nCdhw8c,
709 EXPAND_SIZES_3D(2, 32, 30, 30, 30, 30, 30, 30, 3, 3, 3,
710 1, 1, 1, 1, 1, 1, 1, 1, 1)},
711 pool_bwd_test_params_float {
712 algorithm::pooling_avg_include_padding,
713 memory::format_tag::nCdhw8c,
714 memory::format_tag::nCdhw8c,
715 EXPAND_SIZES_3D(2, 32, 30, 30, 30, 30, 30, 30, 3, 3, 3,
716 1, 1, 1, 1, 1, 1, 1, 1, 1)}));
717
718CPU_INSTANTIATE_TEST_SUITE_P(TestPoolingBackwardMax3DunetNCDHW,
719 pooling_bwd_test_float,
720 ::testing::Values(
721 pool_bwd_test_params_float {algorithm::pooling_max,
722 memory::format_tag::ncdhw, memory::format_tag::ncdhw,
723 EXPAND_SIZES_3D(1, 64, 64, 64, 64, 64, 64, 64, 2, 2, 2,
724 0, 0, 0, 0, 0, 0, 1, 1, 1)},
725 pool_bwd_test_params_float {algorithm::pooling_max,
726 memory::format_tag::ncdhw, memory::format_tag::ncdhw,
727 EXPAND_SIZES_3D(1, 128, 28, 28, 28, 28, 28, 28, 2, 2, 2,
728 1, 1, 1, 0, 0, 0, 1, 1, 1)},
729 pool_bwd_test_params_float {algorithm::pooling_max,
730 memory::format_tag::ncdhw, memory::format_tag::ncdhw,
731 EXPAND_SIZES_3D(1, 256, 12, 12, 12, 12, 12, 12, 2, 2, 2,
732 0, 0, 0, 0, 0, 0, 1, 1, 1)}));
733
734CPU_INSTANTIATE_TEST_SUITE_P(TestPoolingBackwardMax3DunetNDHWC,
735 pooling_bwd_test_float,
736 ::testing::Values(
737 pool_bwd_test_params_float {algorithm::pooling_max,
738 memory::format_tag::ndhwc, memory::format_tag::ndhwc,
739 EXPAND_SIZES_3D(1, 64, 64, 64, 64, 64, 64, 64, 2, 2, 2,
740 0, 0, 0, 0, 0, 0, 1, 1, 1)},
741 pool_bwd_test_params_float {algorithm::pooling_max,
742 memory::format_tag::ndhwc, memory::format_tag::ndhwc,
743 EXPAND_SIZES_3D(1, 128, 28, 28, 28, 28, 28, 28, 2, 2, 2,
744 0, 0, 0, 0, 0, 0, 1, 1, 1)},
745 pool_bwd_test_params_float {algorithm::pooling_max,
746 memory::format_tag::ndhwc, memory::format_tag::ndhwc,
747 EXPAND_SIZES_3D(1, 256, 12, 12, 12, 12, 12, 12, 2, 2, 2,
748 0, 0, 0, 0, 0, 0, 1, 1, 1)}));
749
750CPU_INSTANTIATE_TEST_SUITE_P(TestPoolingBackwardMaxAlexNetNCHW,
751 pooling_bwd_test_float,
752 ::testing::Values(
753 pool_bwd_test_params_float {algorithm::pooling_max,
754 memory::format_tag::nchw, memory::format_tag::nchw,
755 EXPAND_SIZES_2D(
756 2, 16, 55, 55, 27, 27, 3, 3, 0, 0, 0, 0, 2, 2)},
757 pool_bwd_test_params_float {algorithm::pooling_max,
758 memory::format_tag::nchw, memory::format_tag::nchw,
759 EXPAND_SIZES_2D(
760 2, 16, 27, 27, 13, 13, 3, 3, 0, 0, 0, 0, 2, 2)},
761 pool_bwd_test_params_float {algorithm::pooling_max,
762 memory::format_tag::nchw, memory::format_tag::nchw,
763 EXPAND_SIZES_2D(
764 2, 16, 13, 13, 6, 6, 3, 3, 0, 0, 0, 0, 2, 2)}));
765
766CPU_INSTANTIATE_TEST_SUITE_P(TestPoolingBackwardMaxCIFAR10NCHW,
767 pooling_bwd_test_float,
768 ::testing::Values(
769 pool_bwd_test_params_float {algorithm::pooling_max,
770 memory::format_tag::nchw, memory::format_tag::nchw,
771 EXPAND_SIZES_2D(
772 2, 32, 32, 32, 16, 16, 3, 3, 0, 0, 0, 0, 2, 2)},
773 pool_bwd_test_params_float {algorithm::pooling_max,
774 memory::format_tag::nchw, memory::format_tag::nchw,
775 EXPAND_SIZES_2D(
776 2, 32, 16, 16, 8, 8, 3, 3, 0, 0, 0, 0, 2, 2)},
777 pool_bwd_test_params_float {algorithm::pooling_max,
778 memory::format_tag::nchw, memory::format_tag::nchw,
779 EXPAND_SIZES_2D(
780 2, 64, 8, 8, 4, 4, 3, 3, 0, 0, 0, 0, 2, 2)}));
781
782CPU_INSTANTIATE_TEST_SUITE_P(TestPoolingBackwardMax, pooling_bwd_test_float,
783 ::testing::Values(
784 pool_bwd_test_params_float {algorithm::pooling_max,
785 memory::format_tag::nchw, memory::format_tag::nchw,
786 EXPAND_SIZES_2D(
787 1, 1, 2, 2, 1, 1, 2, 2, 0, 0, 0, 0, 1, 1)},
788 pool_bwd_test_params_float {algorithm::pooling_max,
789 memory::format_tag::nchw, memory::format_tag::nchw,
790 EXPAND_SIZES_2D(
791 2, 2, 2, 2, 1, 1, 2, 2, 1, 1, 0, 0, 1, 1)},
792 pool_bwd_test_params_float {algorithm::pooling_max,
793 memory::format_tag::nchw, memory::format_tag::nchw,
794 EXPAND_SIZES_2D(
795 2, 4, 4, 4, 4, 4, 3, 3, 3, 3, 1, 1, 1, 1)}));
796
797CPU_INSTANTIATE_TEST_SUITE_P(TestPoolingBackwardMaxBlocked,
798 pooling_bwd_test_float,
799 ::testing::Values(
800
801 pool_bwd_test_params_float {algorithm::pooling_max,
802 memory::format_tag::nChw8c, memory::format_tag::nChw8c,
803 EXPAND_SIZES_2D(
804 1, 8, 3, 3, 1, 1, 3, 3, 0, 0, 0, 0, 1, 1)},
805 pool_bwd_test_params_float {algorithm::pooling_max,
806 memory::format_tag::nChw8c, memory::format_tag::nChw8c,
807 EXPAND_SIZES_2D(
808 2, 8, 4, 4, 2, 2, 3, 3, 0, 0, 0, 0, 1, 1)},
809 pool_bwd_test_params_float {algorithm::pooling_max,
810 memory::format_tag::nChw8c, memory::format_tag::nChw8c,
811 EXPAND_SIZES_2D(
812 2, 32, 4, 4, 2, 2, 3, 3, 0, 0, 0, 0, 1, 1)},
813 pool_bwd_test_params_float {algorithm::pooling_max,
814 memory::format_tag::nChw8c, memory::format_tag::nChw8c,
815 EXPAND_SIZES_2D(
816 2, 32, 13, 13, 12, 12, 3, 3, 0, 0, 0, 0, 1, 1)},
817 pool_bwd_test_params_float {algorithm::pooling_max,
818 memory::format_tag::nChw8c, memory::format_tag::nChw8c,
819 EXPAND_SIZES_2D(
820 2, 32, 4, 4, 4, 4, 3, 3, 1, 1, 0, 0, 1, 1)},
821 pool_bwd_test_params_float {algorithm::pooling_max,
822 memory::format_tag::nChw8c, memory::format_tag::nChw8c,
823 EXPAND_SIZES_2D(
824 2, 32, 3, 3, 4, 4, 3, 3, 2, 2, 1, 1, 1, 1)},
825 pool_bwd_test_params_float {algorithm::pooling_max,
826 memory::format_tag::nChw8c, memory::format_tag::nChw8c,
827 EXPAND_SIZES_2D(
828 2, 32, 3, 3, 2, 2, 3, 3, 2, 2, 0, 0, 1, 1)},
829 pool_bwd_test_params_float {algorithm::pooling_max,
830 memory::format_tag::nChw8c, memory::format_tag::nChw8c,
831 EXPAND_SIZES_2D(122, 32, 32, 2, 32, 2, 3, 3, 2, 2, 1, 1,
832 1, 1)}));
833
834CPU_INSTANTIATE_TEST_SUITE_P(TestPoolingBackwardAvgBlocked,
835 pooling_bwd_test_float,
836 ::testing::Values(
837 pool_bwd_test_params_float {
838 algorithm::pooling_avg_include_padding,
839 memory::format_tag::nChw8c, memory::format_tag::nChw8c,
840 EXPAND_SIZES_2D(
841 2, 8, 4, 4, 2, 2, 3, 3, 0, 0, 0, 0, 1, 1)},
842 pool_bwd_test_params_float {
843 algorithm::pooling_avg_exclude_padding,
844 memory::format_tag::nChw8c, memory::format_tag::nChw8c,
845 EXPAND_SIZES_2D(
846 2, 8, 4, 4, 2, 2, 3, 3, 0, 0, 0, 0, 1, 1)},
847 pool_bwd_test_params_float {
848 algorithm::pooling_avg_include_padding,
849 memory::format_tag::nChw8c, memory::format_tag::nChw8c,
850 EXPAND_SIZES_2D(
851 2, 32, 4, 4, 2, 2, 3, 3, 0, 0, 0, 0, 1, 1)},
852 pool_bwd_test_params_float {
853 algorithm::pooling_avg_exclude_padding,
854 memory::format_tag::nChw8c, memory::format_tag::nChw8c,
855 EXPAND_SIZES_2D(
856 2, 32, 4, 4, 2, 2, 3, 3, 0, 0, 0, 0, 1, 1)},
857 pool_bwd_test_params_float {
858 algorithm::pooling_avg_include_padding,
859 memory::format_tag::nChw8c, memory::format_tag::nChw8c,
860 EXPAND_SIZES_2D(
861 2, 32, 13, 13, 11, 11, 3, 3, 0, 0, 0, 0, 1, 1)},
862 pool_bwd_test_params_float {
863 algorithm::pooling_avg_exclude_padding,
864 memory::format_tag::nChw8c, memory::format_tag::nChw8c,
865 EXPAND_SIZES_2D(
866 2, 32, 13, 13, 11, 11, 3, 3, 0, 0, 0, 0, 1, 1)},
867 pool_bwd_test_params_float {
868 algorithm::pooling_avg_include_padding,
869 memory::format_tag::nChw8c, memory::format_tag::nChw8c,
870 EXPAND_SIZES_2D(
871 2, 32, 4, 4, 4, 4, 2, 2, 0, 0, 0, 0, 1, 1)},
872 pool_bwd_test_params_float {
873 algorithm::pooling_avg_exclude_padding,
874 memory::format_tag::nChw8c, memory::format_tag::nChw8c,
875 EXPAND_SIZES_2D(
876 2, 32, 4, 4, 4, 4, 2, 2, 0, 0, 0, 0, 1, 1)},
877 pool_bwd_test_params_float {
878 algorithm::pooling_avg_include_padding,
879 memory::format_tag::nChw8c, memory::format_tag::nChw8c,
880 EXPAND_SIZES_2D(
881 2, 32, 3, 3, 3, 3, 3, 3, 0, 0, 1, 1, 1, 1)},
882 pool_bwd_test_params_float {
883 algorithm::pooling_avg_exclude_padding,
884 memory::format_tag::nChw8c, memory::format_tag::nChw8c,
885 EXPAND_SIZES_2D(
886 2, 32, 3, 3, 3, 3, 3, 3, 0, 0, 1, 1, 1, 1)},
887 pool_bwd_test_params_float {
888 algorithm::pooling_avg_include_padding,
889 memory::format_tag::nChw8c, memory::format_tag::nChw8c,
890 EXPAND_SIZES_2D(
891 2, 32, 3, 3, 1, 1, 3, 3, 0, 0, 0, 0, 1, 1)},
892 pool_bwd_test_params_float {
893 algorithm::pooling_avg_exclude_padding,
894 memory::format_tag::nChw8c, memory::format_tag::nChw8c,
895 EXPAND_SIZES_2D(
896 2, 32, 3, 3, 1, 1, 3, 3, 0, 0, 0, 0, 1, 1)},
897 pool_bwd_test_params_float {
898 algorithm::pooling_avg_include_padding,
899 memory::format_tag::nChw8c, memory::format_tag::nChw8c,
900 EXPAND_SIZES_2D(
901 122, 32, 32, 2, 32, 2, 3, 3, 1, 0, 0, 1, 1, 1)},
902 pool_bwd_test_params_float {
903 algorithm::pooling_avg_exclude_padding,
904 memory::format_tag::nChw8c, memory::format_tag::nChw8c,
905 EXPAND_SIZES_2D(
906 122, 32, 32, 2, 32, 2, 3, 3, 1, 0, 0, 1, 1, 1)},
907 pool_bwd_test_params_float {
908 algorithm::pooling_avg_include_padding,
909 memory::format_tag::nChw8c, memory::format_tag::nChw8c,
910 EXPAND_SIZES_2D(
911 122, 32, 32, 2, 32, 2, 3, 3, 1, 1, 0, 0, 1, 1)},
912 pool_bwd_test_params_float {
913 algorithm::pooling_avg_exclude_padding,
914 memory::format_tag::nChw8c, memory::format_tag::nChw8c,
915 EXPAND_SIZES_2D(
916 122, 32, 32, 2, 32, 2, 3, 3, 1, 1, 0, 0, 1, 1)},
917 pool_bwd_test_params_float {
918 algorithm::pooling_avg_include_padding,
919 memory::format_tag::nChw8c, memory::format_tag::nChw8c,
920 EXPAND_SIZES_2D(
921 2, 32, 5, 5, 2, 2, 3, 3, 2, 2, 0, 0, 2, 2)},
922 pool_bwd_test_params_float {
923 algorithm::pooling_avg_exclude_padding,
924 memory::format_tag::nChw8c, memory::format_tag::nChw8c,
925 EXPAND_SIZES_2D(
926 2, 32, 5, 5, 2, 2, 3, 3, 3, 3, 0, 0, 2, 2)},
927 pool_bwd_test_params_float {
928 algorithm::pooling_avg_include_padding,
929 memory::format_tag::nChw8c, memory::format_tag::nChw8c,
930 EXPAND_SIZES_2D(
931 2, 8, 3, 2, 2, 2, 3, 3, 5, 5, 1, 1, 2, 1)},
932 pool_bwd_test_params_float {
933 algorithm::pooling_avg_exclude_padding,
934 memory::format_tag::nChw8c, memory::format_tag::nChw8c,
935 EXPAND_SIZES_2D(
936 2, 8, 3, 2, 2, 2, 3, 3, 1, 1, 1, 1, 2, 1)}
937
938 ));
939
940CPU_INSTANTIATE_TEST_SUITE_P(TestPoolingBackwardMaxBlocked16,
941 pooling_bwd_test_float,
942 ::testing::Values(
943
944 pool_bwd_test_params_float {algorithm::pooling_max,
945 memory::format_tag::nChw16c,
946 memory::format_tag::nChw16c,
947 EXPAND_SIZES_2D(
948 1, 16, 3, 3, 1, 1, 3, 3, 0, 0, 0, 0, 1, 1)},
949 pool_bwd_test_params_float {algorithm::pooling_max,
950 memory::format_tag::nChw16c,
951 memory::format_tag::nChw16c,
952 EXPAND_SIZES_2D(
953 2, 16, 4, 4, 2, 2, 3, 3, 0, 0, 0, 0, 1, 1)},
954 pool_bwd_test_params_float {algorithm::pooling_max,
955 memory::format_tag::nChw16c,
956 memory::format_tag::nChw16c,
957 EXPAND_SIZES_2D(
958 2, 32, 4, 4, 2, 2, 3, 3, 0, 0, 0, 0, 1, 1)},
959 pool_bwd_test_params_float {algorithm::pooling_max,
960 memory::format_tag::nChw16c,
961 memory::format_tag::nChw16c,
962 EXPAND_SIZES_2D(
963 2, 32, 13, 13, 12, 12, 3, 3, 0, 0, 0, 0, 1, 1)},
964 pool_bwd_test_params_float {algorithm::pooling_max,
965 memory::format_tag::nChw16c,
966 memory::format_tag::nChw16c,
967 EXPAND_SIZES_2D(
968 2, 32, 4, 4, 4, 4, 3, 3, 0, 0, 0, 0, 1, 1)},
969 pool_bwd_test_params_float {algorithm::pooling_max,
970 memory::format_tag::nChw16c,
971 memory::format_tag::nChw16c,
972 EXPAND_SIZES_2D(
973 2, 32, 3, 3, 4, 4, 3, 3, 1, 1, 1, 1, 1, 1)},
974 pool_bwd_test_params_float {algorithm::pooling_max,
975 memory::format_tag::nChw16c,
976 memory::format_tag::nChw16c,
977 EXPAND_SIZES_2D(
978 2, 32, 3, 3, 2, 2, 3, 3, 2, 2, 0, 0, 1, 1)},
979 pool_bwd_test_params_float {algorithm::pooling_max,
980 memory::format_tag::nChw16c,
981 memory::format_tag::nChw16c,
982 EXPAND_SIZES_2D(122, 32, 32, 2, 32, 2, 3, 3, 2, 2, 1, 1,
983 1, 1)}));
984
985CPU_INSTANTIATE_TEST_SUITE_P(TestPoolingBackwardAvgBlocked16,
986 pooling_bwd_test_float,
987 ::testing::Values(
988 pool_bwd_test_params_float {
989 algorithm::pooling_avg_include_padding,
990 memory::format_tag::nChw16c,
991 memory::format_tag::nChw16c,
992 EXPAND_SIZES_2D(
993 2, 16, 4, 4, 2, 2, 3, 3, 0, 0, 0, 0, 1, 1)},
994 pool_bwd_test_params_float {
995 algorithm::pooling_avg_exclude_padding,
996 memory::format_tag::nChw16c,
997 memory::format_tag::nChw16c,
998 EXPAND_SIZES_2D(
999 2, 16, 4, 4, 2, 2, 3, 3, 0, 0, 0, 0, 1, 1)},
1000 pool_bwd_test_params_float {
1001 algorithm::pooling_avg_include_padding,
1002 memory::format_tag::nChw16c,
1003 memory::format_tag::nChw16c,
1004 EXPAND_SIZES_2D(
1005 2, 32, 4, 4, 2, 2, 3, 3, 0, 0, 0, 0, 1, 1)},
1006 pool_bwd_test_params_float {
1007 algorithm::pooling_avg_exclude_padding,
1008 memory::format_tag::nChw16c,
1009 memory::format_tag::nChw16c,
1010 EXPAND_SIZES_2D(
1011 2, 32, 4, 4, 2, 2, 3, 3, 0, 0, 0, 0, 1, 1)},
1012 pool_bwd_test_params_float {
1013 algorithm::pooling_avg_include_padding,
1014 memory::format_tag::nChw16c,
1015 memory::format_tag::nChw16c,
1016 EXPAND_SIZES_2D(
1017 2, 32, 13, 13, 11, 11, 3, 3, 0, 0, 0, 0, 1, 1)},
1018 pool_bwd_test_params_float {
1019 algorithm::pooling_avg_exclude_padding,
1020 memory::format_tag::nChw16c,
1021 memory::format_tag::nChw16c,
1022 EXPAND_SIZES_2D(
1023 2, 32, 13, 13, 11, 11, 3, 3, 0, 0, 0, 0, 1, 1)},
1024 pool_bwd_test_params_float {
1025 algorithm::pooling_avg_include_padding,
1026 memory::format_tag::nChw16c,
1027 memory::format_tag::nChw16c,
1028 EXPAND_SIZES_2D(
1029 2, 32, 4, 4, 4, 4, 2, 2, 0, 0, 0, 0, 1, 1)},
1030 pool_bwd_test_params_float {
1031 algorithm::pooling_avg_exclude_padding,
1032 memory::format_tag::nChw16c,
1033 memory::format_tag::nChw16c,
1034 EXPAND_SIZES_2D(
1035 2, 32, 4, 4, 4, 4, 2, 2, 0, 0, 0, 0, 1, 1)},
1036 pool_bwd_test_params_float {
1037 algorithm::pooling_avg_include_padding,
1038 memory::format_tag::nChw16c,
1039 memory::format_tag::nChw16c,
1040 EXPAND_SIZES_2D(
1041 2, 32, 3, 3, 3, 3, 3, 3, 0, 0, 1, 1, 1, 1)},
1042 pool_bwd_test_params_float {
1043 algorithm::pooling_avg_exclude_padding,
1044 memory::format_tag::nChw16c,
1045 memory::format_tag::nChw16c,
1046 EXPAND_SIZES_2D(
1047 2, 32, 3, 3, 3, 3, 3, 3, 0, 0, 1, 1, 1, 1)},
1048 pool_bwd_test_params_float {
1049 algorithm::pooling_avg_include_padding,
1050 memory::format_tag::nChw16c,
1051 memory::format_tag::nChw16c,
1052 EXPAND_SIZES_2D(
1053 2, 32, 3, 3, 1, 1, 3, 3, 0, 0, 0, 0, 1, 1)},
1054 pool_bwd_test_params_float {
1055 algorithm::pooling_avg_exclude_padding,
1056 memory::format_tag::nChw16c,
1057 memory::format_tag::nChw16c,
1058 EXPAND_SIZES_2D(
1059 2, 32, 3, 3, 1, 1, 3, 3, 0, 0, 0, 0, 1, 1)},
1060 pool_bwd_test_params_float {
1061 algorithm::pooling_avg_include_padding,
1062 memory::format_tag::nChw16c,
1063 memory::format_tag::nChw16c,
1064 EXPAND_SIZES_2D(
1065 122, 32, 32, 2, 32, 2, 3, 3, 0, 0, 1, 1, 1, 1)},
1066 pool_bwd_test_params_float {
1067 algorithm::pooling_avg_exclude_padding,
1068 memory::format_tag::nChw16c,
1069 memory::format_tag::nChw16c,
1070 EXPAND_SIZES_2D(
1071 122, 32, 32, 2, 32, 2, 3, 3, 0, 0, 1, 1, 1, 1)},
1072 pool_bwd_test_params_float {
1073 algorithm::pooling_avg_include_padding,
1074 memory::format_tag::nChw16c,
1075 memory::format_tag::nChw16c,
1076 EXPAND_SIZES_2D(
1077 122, 32, 32, 2, 32, 2, 3, 3, 1, 1, 0, 0, 1, 1)},
1078 pool_bwd_test_params_float {
1079 algorithm::pooling_avg_exclude_padding,
1080 memory::format_tag::nChw16c,
1081 memory::format_tag::nChw16c,
1082 EXPAND_SIZES_2D(
1083 122, 32, 32, 2, 32, 2, 3, 3, 1, 1, 0, 0, 1, 1)},
1084 pool_bwd_test_params_float {
1085 algorithm::pooling_avg_include_padding,
1086 memory::format_tag::nChw16c,
1087 memory::format_tag::nChw16c,
1088 EXPAND_SIZES_2D(
1089 2, 32, 5, 5, 2, 2, 3, 3, 2, 2, 0, 0, 2, 2)},
1090 pool_bwd_test_params_float {
1091 algorithm::pooling_avg_exclude_padding,
1092 memory::format_tag::nChw16c,
1093 memory::format_tag::nChw16c,
1094 EXPAND_SIZES_2D(
1095 2, 32, 5, 5, 2, 2, 3, 3, 3, 3, 0, 0, 2, 2)},
1096 pool_bwd_test_params_float {
1097 algorithm::pooling_avg_include_padding,
1098 memory::format_tag::nChw16c,
1099 memory::format_tag::nChw16c,
1100 EXPAND_SIZES_2D(
1101 2, 16, 3, 2, 2, 2, 3, 3, 5, 5, 1, 1, 2, 1)},
1102 pool_bwd_test_params_float {
1103 algorithm::pooling_avg_exclude_padding,
1104 memory::format_tag::nChw16c,
1105 memory::format_tag::nChw16c,
1106 EXPAND_SIZES_2D(
1107 2, 16, 3, 2, 2, 2, 3, 3, 1, 1, 1, 1, 2, 1)}
1108
1109 ));
1110
1111CPU_INSTANTIATE_TEST_SUITE_P(TestPoolingBackwardMaxBlockedPerf,
1112 pooling_bwd_test_float,
1113 ::testing::Values(pool_bwd_test_params_float {algorithm::pooling_max,
1114 memory::format_tag::nChw8c, memory::format_tag::nChw8c,
1115 EXPAND_SIZES_2D(
1116 16, 64, 32, 32, 16, 16, 3, 3, 0, 0, 0, 0, 2, 2)}));
1117
1118CPU_INSTANTIATE_TEST_SUITE_P(TestPoolingBackwardAvgBlockedPerf,
1119 pooling_bwd_test_float,
1120 ::testing::Values(
1121 pool_bwd_test_params_float {
1122 algorithm::pooling_avg_include_padding,
1123 memory::format_tag::nChw8c, memory::format_tag::nChw8c,
1124 EXPAND_SIZES_2D(16, 64, 32, 32, 16, 16, 3, 3, 0, 0, 0,
1125 0, 2, 2)},
1126 pool_bwd_test_params_float {
1127 algorithm::pooling_avg_exclude_padding,
1128 memory::format_tag::nChw8c, memory::format_tag::nChw8c,
1129 EXPAND_SIZES_2D(16, 64, 32, 32, 16, 16, 3, 3, 0, 0, 1,
1130 1, 2, 2)}));
1131
1132CPU_INSTANTIATE_TEST_SUITE_P(TestPoolingBackwardMaxBlocked16Perf,
1133 pooling_bwd_test_float,
1134 ::testing::Values(pool_bwd_test_params_float {algorithm::pooling_max,
1135 memory::format_tag::nChw16c, memory::format_tag::nChw16c,
1136 EXPAND_SIZES_2D(
1137 16, 64, 32, 32, 16, 16, 3, 3, 0, 0, 0, 0, 2, 2)}));
1138
1139CPU_INSTANTIATE_TEST_SUITE_P(TestPoolingBackwardAvgBlocked16Perf,
1140 pooling_bwd_test_float,
1141 ::testing::Values(
1142 pool_bwd_test_params_float {
1143 algorithm::pooling_avg_include_padding,
1144 memory::format_tag::nChw16c,
1145 memory::format_tag::nChw16c,
1146 EXPAND_SIZES_2D(16, 64, 32, 32, 16, 16, 3, 3, 0, 0, 0,
1147 0, 2, 2)},
1148 pool_bwd_test_params_float {
1149 algorithm::pooling_avg_exclude_padding,
1150 memory::format_tag::nChw16c,
1151 memory::format_tag::nChw16c,
1152 EXPAND_SIZES_2D(16, 64, 32, 32, 16, 16, 3, 3, 1, 1, 0,
1153 0, 2, 2)}));
1154
1155CPU_INSTANTIATE_TEST_SUITE_P(TestPoolingBackwardAsymmPadding,
1156 pooling_bwd_test_float,
1157 ::testing::Values(
1158 pool_bwd_test_params_float {algorithm::pooling_max,
1159 memory::format_tag::nChw8c, memory::format_tag::nChw8c,
1160 EXPAND_SIZES_2D(
1161 1, 8, 3, 4, 1, 5, 3, 3, 0, 0, 0, 1, 1, 1)},
1162 pool_bwd_test_params_float {
1163 algorithm::pooling_avg_include_padding,
1164 memory::format_tag::nChw8c, memory::format_tag::nChw8c,
1165 EXPAND_SIZES_2D(
1166 1, 8, 3, 4, 1, 5, 3, 3, 0, 0, 0, 1, 1, 1)},
1167 pool_bwd_test_params_float {
1168 algorithm::pooling_avg_exclude_padding,
1169 memory::format_tag::nChw8c, memory::format_tag::nChw8c,
1170 EXPAND_SIZES_2D(
1171 1, 8, 3, 4, 1, 5, 3, 3, 1, 1, 0, 1, 1, 1)}
1172
1173 ,
1174 pool_bwd_test_params_float {algorithm::pooling_max,
1175 memory::format_tag::nChw8c, memory::format_tag::nChw8c,
1176 EXPAND_SIZES_2D(
1177 1, 8, 3, 14, 1, 8, 3, 3, 0, 0, 0, 1, 1, 2)},
1178 pool_bwd_test_params_float {
1179 algorithm::pooling_avg_include_padding,
1180 memory::format_tag::nChw8c, memory::format_tag::nChw8c,
1181 EXPAND_SIZES_2D(
1182 1, 8, 3, 14, 1, 8, 3, 3, 0, 0, 0, 1, 1, 2)},
1183 pool_bwd_test_params_float {
1184 algorithm::pooling_avg_exclude_padding,
1185 memory::format_tag::nChw8c, memory::format_tag::nChw8c,
1186 EXPAND_SIZES_2D(
1187 1, 8, 3, 14, 1, 8, 3, 3, 1, 1, 0, 1, 1, 2)}
1188
1189 ,
1190 pool_bwd_test_params_float {algorithm::pooling_max,
1191 memory::format_tag::nChw8c, memory::format_tag::nChw8c,
1192 EXPAND_SIZES_2D(
1193 1, 96, 3, 100, 1, 51, 3, 3, 0, 0, 0, 1, 1, 2)},
1194 pool_bwd_test_params_float {
1195 algorithm::pooling_avg_include_padding,
1196 memory::format_tag::nChw8c, memory::format_tag::nChw8c,
1197 EXPAND_SIZES_2D(
1198 1, 96, 3, 100, 1, 51, 3, 3, 0, 0, 0, 1, 1, 2)},
1199 pool_bwd_test_params_float {
1200 algorithm::pooling_avg_exclude_padding,
1201 memory::format_tag::nChw8c, memory::format_tag::nChw8c,
1202 EXPAND_SIZES_2D(
1203 1, 96, 3, 100, 1, 51, 3, 3, 1, 1, 0, 1, 1, 2)}
1204
1205 ,
1206 pool_bwd_test_params_float {algorithm::pooling_max,
1207 memory::format_tag::nChw8c, memory::format_tag::nChw8c,
1208 EXPAND_SIZES_2D(
1209 1, 96, 3, 102, 1, 52, 3, 3, 0, 0, 0, 1, 1, 2)},
1210 pool_bwd_test_params_float {
1211 algorithm::pooling_avg_include_padding,
1212 memory::format_tag::nChw8c, memory::format_tag::nChw8c,
1213 EXPAND_SIZES_2D(
1214 1, 96, 3, 102, 1, 52, 3, 3, 0, 0, 0, 1, 1, 2)},
1215 pool_bwd_test_params_float {
1216 algorithm::pooling_avg_exclude_padding,
1217 memory::format_tag::nChw8c, memory::format_tag::nChw8c,
1218 EXPAND_SIZES_2D(
1219 1, 96, 3, 102, 1, 52, 3, 3, 1, 1, 0, 1, 1, 2)}
1220
1221 ,
1222 pool_bwd_test_params_float {algorithm::pooling_max,
1223 memory::format_tag::nChw8c, memory::format_tag::nChw8c,
1224 EXPAND_SIZES_2D(
1225 1, 96, 9, 103, 7, 52, 3, 3, 0, 0, 0, 1, 1, 2)},
1226 pool_bwd_test_params_float {
1227 algorithm::pooling_avg_include_padding,
1228 memory::format_tag::nChw8c, memory::format_tag::nChw8c,
1229 EXPAND_SIZES_2D(
1230 1, 96, 9, 103, 7, 52, 3, 3, 0, 0, 0, 1, 1, 2)},
1231 pool_bwd_test_params_float {
1232 algorithm::pooling_avg_exclude_padding,
1233 memory::format_tag::nChw8c, memory::format_tag::nChw8c,
1234 EXPAND_SIZES_2D(
1235 1, 96, 9, 103, 7, 52, 3, 3, 1, 1, 0, 1, 1, 2)}
1236
1237 ,
1238 pool_bwd_test_params_float {algorithm::pooling_max,
1239 memory::format_tag::nChw8c, memory::format_tag::nChw8c,
1240 EXPAND_SIZES_2D(1, 96, 300, 500, 151, 251, 3, 3, 0, 0,
1241 1, 1, 2, 2)},
1242 pool_bwd_test_params_float {
1243 algorithm::pooling_avg_include_padding,
1244 memory::format_tag::nChw8c, memory::format_tag::nChw8c,
1245 EXPAND_SIZES_2D(1, 96, 300, 500, 151, 251, 3, 3, 0, 0,
1246 1, 1, 2, 2)},
1247 pool_bwd_test_params_float {
1248 algorithm::pooling_avg_exclude_padding,
1249 memory::format_tag::nChw8c, memory::format_tag::nChw8c,
1250 EXPAND_SIZES_2D(1, 96, 300, 500, 151, 251, 3, 3, 1, 1,
1251 1, 1, 2, 2)}
1252
1253 ));
1254
1255CPU_INSTANTIATE_TEST_SUITE_P(TestPoolingAsymmDilation, pooling_bwd_test_float,
1256 ::testing::Values(
1257 pool_bwd_test_params_float {algorithm::pooling_max,
1258 memory::format_tag::nChw8c, memory::format_tag::nChw8c,
1259 EXPAND_SIZES_2D(
1260 1, 8, 3, 4, 1, 5, 3, 3, 1, 0, 1, 1, 1, 1)},
1261 pool_bwd_test_params_float {
1262 algorithm::pooling_avg_include_padding,
1263 memory::format_tag::nChw8c, memory::format_tag::nChw8c,
1264 EXPAND_SIZES_2D(
1265 1, 8, 3, 4, 1, 5, 3, 3, 1, 0, 1, 1, 1, 1)},
1266 pool_bwd_test_params_float {
1267 algorithm::pooling_avg_exclude_padding,
1268 memory::format_tag::nChw8c, memory::format_tag::nChw8c,
1269 EXPAND_SIZES_2D(
1270 1, 8, 3, 4, 1, 5, 3, 3, 1, 0, 1, 1, 1, 1)}
1271
1272 ,
1273 pool_bwd_test_params_float {algorithm::pooling_max,
1274 memory::format_tag::nChw8c, memory::format_tag::nChw8c,
1275 EXPAND_SIZES_2D(
1276 1, 8, 3, 4, 1, 5, 3, 3, 0, 1, 1, 1, 1, 1)},
1277 pool_bwd_test_params_float {
1278 algorithm::pooling_avg_include_padding,
1279 memory::format_tag::nChw8c, memory::format_tag::nChw8c,
1280 EXPAND_SIZES_2D(
1281 1, 8, 3, 4, 1, 5, 3, 3, 0, 1, 1, 1, 1, 1)},
1282 pool_bwd_test_params_float {
1283 algorithm::pooling_avg_exclude_padding,
1284 memory::format_tag::nChw8c, memory::format_tag::nChw8c,
1285 EXPAND_SIZES_2D(
1286 1, 8, 3, 4, 1, 5, 3, 3, 0, 1, 1, 1, 1, 1)}
1287
1288 ,
1289 pool_bwd_test_params_float {algorithm::pooling_max,
1290 memory::format_tag::nChw8c, memory::format_tag::nChw8c,
1291 EXPAND_SIZES_2D(1, 96, 300, 500, 151, 251, 3, 3, 2, 4,
1292 1, 1, 2, 2)},
1293 pool_bwd_test_params_float {
1294 algorithm::pooling_avg_include_padding,
1295 memory::format_tag::nChw8c, memory::format_tag::nChw8c,
1296 EXPAND_SIZES_2D(1, 96, 300, 500, 151, 251, 3, 3, 2, 4,
1297 1, 1, 2, 2)},
1298 pool_bwd_test_params_float {
1299 algorithm::pooling_avg_exclude_padding,
1300 memory::format_tag::nChw8c, memory::format_tag::nChw8c,
1301 EXPAND_SIZES_2D(1, 96, 300, 500, 151, 251, 3, 3, 2, 4,
1302 1, 1, 2, 2)}
1303
1304 ,
1305 pool_bwd_test_params_float {algorithm::pooling_max,
1306 memory::format_tag::nChw8c, memory::format_tag::nChw8c,
1307 EXPAND_SIZES_2D(1, 96, 300, 500, 151, 251, 3, 3, 4, 2,
1308 1, 1, 2, 2)},
1309 pool_bwd_test_params_float {
1310 algorithm::pooling_avg_include_padding,
1311 memory::format_tag::nChw8c, memory::format_tag::nChw8c,
1312 EXPAND_SIZES_2D(1, 96, 300, 500, 151, 251, 3, 3, 4, 2,
1313 1, 1, 2, 2)},
1314 pool_bwd_test_params_float {
1315 algorithm::pooling_avg_exclude_padding,
1316 memory::format_tag::nChw8c, memory::format_tag::nChw8c,
1317 EXPAND_SIZES_2D(1, 96, 300, 500, 151, 251, 3, 3, 4, 2,
1318 1, 1, 2, 2)}));
1319
1320GPU_INSTANTIATE_TEST_SUITE_P(TestPoolingSlipsToPadding, pooling_bwd_test_float,
1321 ::testing::Values(pool_bwd_test_params_t {algorithm::pooling_max,
1322 memory::format_tag::NChw16n16c,
1323 memory::format_tag::NChw16n16c,
1324 EXPAND_SIZES_2D(64, 64, 56, 56, 56, 56, 3, 3,
1325 0, 0, 1, 1, 1, 1)},
1326 pool_bwd_test_params_t {algorithm::pooling_avg_exclude_padding,
1327 memory::format_tag::NChw16n16c,
1328 memory::format_tag::NChw16n16c,
1329 EXPAND_SIZES_2D(64, 64, 56, 56, 56, 56, 3, 3, 0, 0, 1,
1330 1, 1, 1)},
1331 pool_bwd_test_params_t {algorithm::pooling_avg_include_padding,
1332 memory::format_tag::NChw16n16c,
1333 memory::format_tag::NChw16n16c,
1334 EXPAND_SIZES_2D(64, 64, 56, 56, 56, 56, 3, 3, 0, 0, 1,
1335 1, 1, 1)}));
1336
1337GPU_INSTANTIATE_TEST_SUITE_P(TestPooling_ncdhw, pooling_bwd_test_float,
1338 ::testing::Values(
1339 pool_bwd_test_params_float {algorithm::pooling_max,
1340 memory::format_tag::ncdhw, memory::format_tag::ncdhw,
1341 EXPAND_SIZES_3D(5, 32, 14, 14, 14, 14, 14, 14, 3, 3, 3,
1342 0, 0, 0, 1, 1, 1, 1, 1, 1)},
1343 pool_bwd_test_params_float {
1344 algorithm::pooling_avg_exclude_padding,
1345 memory::format_tag::ncdhw, memory::format_tag::ncdhw,
1346 EXPAND_SIZES_3D(5, 32, 14, 14, 14, 14, 14, 14, 3, 3, 3,
1347 0, 0, 0, 1, 1, 1, 1, 1, 1)},
1348 pool_bwd_test_params_float {
1349 algorithm::pooling_avg_include_padding,
1350 memory::format_tag::ncdhw, memory::format_tag::ncdhw,
1351 EXPAND_SIZES_3D(5, 32, 14, 14, 14, 14, 14, 14, 3, 3, 3,
1352 0, 0, 0, 1, 1, 1, 1, 1, 1)},
1353 pool_bwd_test_params_float {algorithm::pooling_max,
1354 memory::format_tag::NCdhw16n16c,
1355 memory::format_tag::NCdhw16n16c,
1356 EXPAND_SIZES_3D(32, 32, 14, 14, 14, 14, 14, 14, 3, 3, 3,
1357 0, 0, 0, 1, 1, 1, 1, 1, 1)},
1358 pool_bwd_test_params_float {
1359 algorithm::pooling_avg_exclude_padding,
1360 memory::format_tag::NCdhw16n16c,
1361 memory::format_tag::NCdhw16n16c,
1362 EXPAND_SIZES_3D(32, 32, 14, 14, 14, 14, 14, 14, 3, 3, 3,
1363 0, 0, 0, 1, 1, 1, 1, 1, 1)},
1364 pool_bwd_test_params_float {
1365 algorithm::pooling_avg_include_padding,
1366 memory::format_tag::NCdhw16n16c,
1367 memory::format_tag::NCdhw16n16c,
1368 EXPAND_SIZES_3D(32, 32, 14, 14, 14, 14, 14, 14, 3, 3, 3,
1369 1, 1, 1, 1, 1, 1, 1, 1, 1)},
1370 pool_bwd_test_params_float {algorithm::pooling_max,
1371 memory::format_tag::nCdhw16c,
1372 memory::format_tag::nCdhw16c,
1373 EXPAND_SIZES_3D(3, 32, 14, 14, 14, 14, 14, 14, 3, 3, 3,
1374 2, 2, 2, 1, 1, 1, 1, 1, 1)},
1375 pool_bwd_test_params_float {
1376 algorithm::pooling_avg_exclude_padding,
1377 memory::format_tag::nCdhw16c,
1378 memory::format_tag::nCdhw16c,
1379 EXPAND_SIZES_3D(3, 32, 14, 14, 14, 14, 14, 14, 3, 3, 3,
1380 3, 3, 3, 1, 1, 1, 1, 1, 1)},
1381 pool_bwd_test_params_float {
1382 algorithm::pooling_avg_include_padding,
1383 memory::format_tag::nCdhw16c,
1384 memory::format_tag::nCdhw16c,
1385 EXPAND_SIZES_3D(3, 32, 14, 14, 14, 14, 14, 14, 3, 3, 3,
1386 5, 5, 5, 1, 1, 1, 1, 1, 1)}));
1387
1388} // namespace dnnl
1389#endif // DNNL_AARCH64_USE_ACL
1390