Publishing 2019 R1 content
[platform/upstream/dldt.git] / inference-engine / thirdparty / mkl-dnn / tests / gtests / test_binary_convolution_binarization_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, TestBinaryConvolutionBinarization)
28 {
29 }
30
31 #define BIN
32 #define WITH_BINARIZATION
33 #define DIRECTION_FORWARD
34 #include "convolution_common.h"
35
36 #define PARAMS_WITH_BINARIZATION(...) \
37     EXPAND_ARGS(PARAMS(binarization_depthwise, __VA_ARGS__))
38
39 INST_TEST_CASE(SimpleSmall_Blocked_Padded_Channels,
40     PARAMS_WITH_BINARIZATION(FMT_DATA_BLOCKED, FMT_WEIGHTS_BLOCKED, FMT_BIAS, FMT_DATA_BLOCKED,
41         2, 1, 3, 10, 10, 3, 10, 10, 3, 3, 1, 1, 1, 1),
42     PARAMS_WITH_BINARIZATION(FMT_DATA_BLOCKED, FMT_WEIGHTS_BLOCKED, FMT_BIAS, FMT_DATA_BLOCKED,
43         2, 1, 3, 10, 10, 32, 10, 10, 3, 3, 1, 1, 1, 1),
44     PARAMS_WITH_BINARIZATION(FMT_DATA_BLOCKED, FMT_WEIGHTS_BLOCKED, FMT_BIAS, FMT_DATA_BLOCKED,
45         2, 1, 3, 10, 10, 41, 10, 10, 3, 3, 1, 1, 1, 1),
46     PARAMS_WITH_BINARIZATION(FMT_DATA_BLOCKED, FMT_WEIGHTS_BLOCKED, FMT_BIAS, FMT_DATA_BLOCKED,
47         2, 1, 47, 10, 10, 137, 10, 10, 3, 3, 1, 1, 1, 1),
48     PARAMS_WITH_BINARIZATION(FMT_DATA_BLOCKED, FMT_WEIGHTS_BLOCKED, FMT_BIAS, FMT_DATA_BLOCKED,
49         2, 1, 256, 10, 10, 256, 10, 10, 3, 3, 1, 1, 1, 1)
50 );
51
52 INST_TEST_CASE(SimpleSmall_Blocked_1x1_Padded_Channels,
53     PARAMS_WITH_BINARIZATION(FMT_DATA_BLOCKED, FMT_WEIGHTS_BLOCKED, FMT_BIAS, FMT_DATA_BLOCKED,
54         2, 1, 3, 10, 10, 3, 10, 10, 1, 1, 0, 0, 1, 1),
55     PARAMS_WITH_BINARIZATION(FMT_DATA_BLOCKED, FMT_WEIGHTS_BLOCKED, FMT_BIAS, FMT_DATA_BLOCKED,
56         2, 1, 13, 3, 3, 32, 3, 3, 1, 1, 0, 0, 1, 1),
57     PARAMS_WITH_BINARIZATION(FMT_DATA_BLOCKED, FMT_WEIGHTS_BLOCKED, FMT_BIAS, FMT_DATA_BLOCKED,
58         2, 1, 13, 3, 3, 41, 3, 3, 1, 1, 0, 0, 1, 1),
59     PARAMS_WITH_BINARIZATION(FMT_DATA_BLOCKED, FMT_WEIGHTS_BLOCKED, FMT_BIAS, FMT_DATA_BLOCKED,
60         2, 1, 47, 3, 3, 137, 3, 3, 1, 1, 0, 0, 1, 1),
61     PARAMS_WITH_BINARIZATION(FMT_DATA_BLOCKED, FMT_WEIGHTS_BLOCKED, FMT_BIAS, FMT_DATA_BLOCKED,
62         2, 1, 256, 3, 3, 256, 3, 3, 1, 1, 0, 0, 1, 1)
63 );
64
65 //INST_TEST_CASE(SimpleSmall_Depthwise_Blocked_Padded_Channels,
66 //    PARAMS_WITH_BINARIZATION(FMT_DATA_BLOCKED, FMT_WEIGHTS_BLOCKED_G, FMT_BIAS, FMT_DATA_BLOCKED,
67 //        2, 32, 32, 10, 10, 32, 10, 10, 3, 3, 1, 1, 1, 1),
68 //    PARAMS_WITH_BINARIZATION(FMT_DATA_BLOCKED, FMT_WEIGHTS_BLOCKED_G, FMT_BIAS, FMT_DATA_BLOCKED,
69 //        2, 43, 43, 10, 10, 43, 10, 10, 3, 3, 1, 1, 1, 1),
70 //    PARAMS_WITH_BINARIZATION(FMT_DATA_BLOCKED, FMT_WEIGHTS_BLOCKED_G, FMT_BIAS, FMT_DATA_BLOCKED,
71 //        2, 256, 256, 10, 10, 256, 10, 10, 3, 3, 1, 1, 1, 1)
72 //);
73
74 }