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