1 /*******************************************************************************
2 * Copyright 2019 Intel Corporation
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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 *******************************************************************************/
17 #include "mkldnn_test_common.hpp"
18 #include "gtest/gtest.h"
21 #include "test_binary_convolution_dw_conv_forward_common.hpp"
25 using binary_convolution_test = binary_convolution_forward_test;
27 TEST_P(binary_convolution_test, TestBinaryConvolutionDwConvBinarization)
33 #define WITH_BINARIZATION
34 #define DIRECTION_FORWARD
35 #include "convolution_common.h"
37 #define PARAMS_WITH_BINARIZATION(...) \
38 EXPAND_ARGS(PARAMS(binarization_depthwise, __VA_ARGS__))
40 INST_TEST_CASE(SimpleSmall_Blocked,
41 PARAMS_WITH_BINARIZATION(FMT_DATA_BLOCKED, FMT_WEIGHTS_BLOCKED, FMT_BIAS, FMT_WEIGHTS_DW_BLOCKED, FMT_BIAS, FMT_DATA_BLOCKED,
42 1, 19, 5, 5, 77, 1, 1, 0, 0, 1, 1, 77, 3, 3, 1, 1, 1, 1)
45 INST_TEST_CASE(Mobilenet_Blocked,
46 PARAMS_WITH_BINARIZATION(FMT_DATA_BLOCKED, FMT_WEIGHTS_BLOCKED, FMT_BIAS, FMT_WEIGHTS_DW_BLOCKED, FMT_BIAS, FMT_DATA_BLOCKED,
47 2, 8, 19, 33, 56, 3, 3, 1, 1, 2, 2, 56, 3, 3, 1, 1, 1, 1), // 1_1
48 PARAMS_WITH_BINARIZATION(FMT_DATA_BLOCKED, FMT_WEIGHTS_BLOCKED, FMT_BIAS, FMT_WEIGHTS_DW_BLOCKED, FMT_BIAS, FMT_DATA_BLOCKED,
49 2, 56, 9, 16, 112, 1, 1, 0, 0, 1, 1, 112, 3, 3, 1, 1, 1, 1), // 2_2
50 PARAMS_WITH_BINARIZATION(FMT_DATA_BLOCKED, FMT_WEIGHTS_BLOCKED, FMT_BIAS, FMT_WEIGHTS_DW_BLOCKED, FMT_BIAS, FMT_DATA_BLOCKED,
51 2, 112, 9, 16, 112, 1, 1, 0, 0, 1, 1, 112, 3, 3, 1, 1, 2, 2), // 3_1
52 PARAMS_WITH_BINARIZATION(FMT_DATA_BLOCKED, FMT_WEIGHTS_BLOCKED, FMT_BIAS, FMT_WEIGHTS_DW_BLOCKED, FMT_BIAS, FMT_DATA_BLOCKED,
53 2, 288, 2, 4, 240, 1, 1, 0, 0, 1, 1, 240, 3, 3, 1, 1, 1, 1) // 5_3