1 /*******************************************************************************
2 * Copyright 2018 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 #ifndef CPU_BATCH_NORMALIZATION_UTILS_HPP
18 #define CPU_BATCH_NORMALIZATION_UTILS_HPP
20 #include "batch_normalization_pd.hpp"
25 namespace bnorm_utils {
27 void cache_balance(size_t working_set_size, int C_blks, int &C_blks_per_iter,
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);
35 bool is_spatial_thr(const batch_normalization_pd_t *bdesc, int simd_w,