Publishing 2019 R1 content
[platform/upstream/dldt.git] / inference-engine / thirdparty / mkl-dnn / tests / gtests / test_binary_convolution_depthwise_forward.cpp
1 /*******************************************************************************
2 * Copyright 2019 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 "mkldnn_test_common.hpp"
18 #include "gtest/gtest.h"
19
20 #include "mkldnn.hpp"
21 #include "test_binary_convolution_forward_common.hpp"
22
23 namespace mkldnn {
24
25 using binary_convolution_test = binary_convolution_forward_test;
26
27 TEST_P(binary_convolution_test, TestBinaryConvolutionDepthwise)
28 {
29 }
30
31 #define BIN
32 #define WITH_DEPTHWISE
33 #define DIRECTION_FORWARD
34 #include "convolution_common.h"
35
36 #define PARAMS_WITH_DEPTHWISE(...) \
37     EXPAND_ARGS(PARAMS(depthwise_scale_shift, __VA_ARGS__)), \
38     EXPAND_ARGS(PARAMS(depthwise_prelu, __VA_ARGS__))
39
40 INST_TEST_CASE(SimpleSmall_Blocked_Padded_Channels,
41     PARAMS_WITH_DEPTHWISE(FMT_DATA_BLOCKED, FMT_WEIGHTS_BLOCKED, FMT_BIAS, FMT_DATA_BLOCKED,
42         2, 1, 3, 10, 10, 3, 10, 10, 3, 3, 1, 1, 1, 1),
43     PARAMS_WITH_DEPTHWISE(FMT_DATA_BLOCKED, FMT_WEIGHTS_BLOCKED, FMT_BIAS, FMT_DATA_BLOCKED,
44         2, 1, 3, 10, 10, 32, 10, 10, 3, 3, 1, 1, 1, 1),
45     PARAMS_WITH_DEPTHWISE(FMT_DATA_BLOCKED, FMT_WEIGHTS_BLOCKED, FMT_BIAS, FMT_DATA_BLOCKED,
46         2, 1, 3, 10, 10, 41, 10, 10, 3, 3, 1, 1, 1, 1),
47     PARAMS_WITH_DEPTHWISE(FMT_DATA_BLOCKED, FMT_WEIGHTS_BLOCKED, FMT_BIAS, FMT_DATA_BLOCKED,
48         2, 1, 47, 10, 10, 137, 10, 10, 3, 3, 1, 1, 1, 1),
49     PARAMS_WITH_DEPTHWISE(FMT_DATA_BLOCKED, FMT_WEIGHTS_BLOCKED, FMT_BIAS, FMT_DATA_BLOCKED,
50         2, 1, 256, 10, 10, 256, 10, 10, 3, 3, 1, 1, 1, 1)
51 );
52
53 INST_TEST_CASE(SimpleSmall_Blocked_1x1_Padded_Channels,
54     PARAMS_WITH_DEPTHWISE(FMT_DATA_BLOCKED, FMT_WEIGHTS_BLOCKED, FMT_BIAS, FMT_DATA_BLOCKED,
55         2, 1, 3, 10, 10, 3, 10, 10, 1, 1, 0, 0, 1, 1),
56     PARAMS_WITH_DEPTHWISE(FMT_DATA_BLOCKED, FMT_WEIGHTS_BLOCKED, FMT_BIAS, FMT_DATA_BLOCKED,
57         2, 1, 13, 3, 3, 32, 3, 3, 1, 1, 0, 0, 1, 1),
58     PARAMS_WITH_DEPTHWISE(FMT_DATA_BLOCKED, FMT_WEIGHTS_BLOCKED, FMT_BIAS, FMT_DATA_BLOCKED,
59         2, 1, 13, 3, 3, 41, 3, 3, 1, 1, 0, 0, 1, 1),
60     PARAMS_WITH_DEPTHWISE(FMT_DATA_BLOCKED, FMT_WEIGHTS_BLOCKED, FMT_BIAS, FMT_DATA_BLOCKED,
61         2, 1, 47, 3, 3, 137, 3, 3, 1, 1, 0, 0, 1, 1),
62     PARAMS_WITH_DEPTHWISE(FMT_DATA_BLOCKED, FMT_WEIGHTS_BLOCKED, FMT_BIAS, FMT_DATA_BLOCKED,
63         2, 1, 256, 3, 3, 256, 3, 3, 1, 1, 0, 0, 1, 1)
64 );
65
66 //INST_TEST_CASE(SimpleSmall_Depthwise_Blocked_Padded_Channels,
67 //    PARAMS_WITH_DEPTHWISE(FMT_DATA_BLOCKED, FMT_WEIGHTS_BLOCKED_G, FMT_BIAS, FMT_DATA_BLOCKED,
68 //        2, 32, 32, 10, 10, 32, 10, 10, 3, 3, 1, 1, 1, 1),
69 //    PARAMS_WITH_DEPTHWISE(FMT_DATA_BLOCKED, FMT_WEIGHTS_BLOCKED_G, FMT_BIAS, FMT_DATA_BLOCKED,
70 //        2, 43, 43, 10, 10, 43, 10, 10, 3, 3, 1, 1, 1, 1),
71 //    PARAMS_WITH_DEPTHWISE(FMT_DATA_BLOCKED, FMT_WEIGHTS_BLOCKED_G, FMT_BIAS, FMT_DATA_BLOCKED,
72 //        2, 256, 256, 10, 10, 256, 10, 10, 3, 3, 1, 1, 1, 1)
73 //);
74
75 }