Add a section of how to link IE with CMake project (#99)
[platform/upstream/dldt.git] / inference-engine / thirdparty / mkl-dnn / src / common / convolution_relu.cpp
1 /*******************************************************************************
2 * Copyright 2016-2018 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 <assert.h>
18 #include "mkldnn.h"
19
20 #include "c_types_map.hpp"
21 #include "type_helpers.hpp"
22 #include "utils.hpp"
23
24 using namespace mkldnn::impl;
25 using namespace mkldnn::impl::utils;
26 using namespace mkldnn::impl::status;
27 using namespace mkldnn::impl::prop_kind;
28 using namespace mkldnn::impl::alg_kind;
29
30 status_t mkldnn_convolution_relu_desc_init(
31         convolution_relu_desc_t *conv_relu_desc,
32         const convolution_desc_t *conv_desc, float negative_slope) {
33     bool args_ok = !any_null(conv_relu_desc, conv_desc)
34         && utils::one_of(conv_desc->prop_kind, prop_kind::forward_training,
35                 prop_kind::forward_inference);
36     if (!args_ok) return invalid_arguments;
37     conv_relu_desc->primitive_kind = primitive_kind::convolution_relu;
38     conv_relu_desc->convolution_desc = *conv_desc;
39     conv_relu_desc->negative_slope = negative_slope;
40     return success;
41 }
42
43 // vim: et ts=4 sw=4 cindent cino^=l0,\:0,N-s