Publishing 2019 R1 content
[platform/upstream/dldt.git] / inference-engine / thirdparty / mkl-dnn / src / cpu / cpu_batch_normalization_utils.hpp
1 /*******************************************************************************
2 * Copyright 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 #ifndef CPU_BATCH_NORMALIZATION_UTILS_HPP
18 #define CPU_BATCH_NORMALIZATION_UTILS_HPP
19
20 #include "batch_normalization_pd.hpp"
21
22 namespace mkldnn {
23 namespace impl {
24 namespace cpu {
25 namespace bnorm_utils {
26
27 void cache_balance(size_t working_set_size, int C_blks, int &C_blks_per_iter,
28         int &iters);
29
30 bool thread_balance(bool do_blocking, bool spatial_thr_allowed, int ithr,
31         int nthr, int N, int C_blks, int SP, int &C_ithr, int &C_nthr,
32         int &C_blk_s, int &C_blk_e, int &N_ithr, int &N_nthr, int &N_s,
33         int &N_e, int &S_ithr, int &S_nthr, int &S_s, int &S_e);
34
35 bool is_spatial_thr(const batch_normalization_pd_t *bdesc, int simd_w,
36         int data_size);
37
38 }
39 }
40 }
41 }
42
43 #endif