| 236 | } |
| 237 | |
| 238 | size_t CpuAddKernel::get_mws(const CPUInfo &platform, size_t thread_count) const |
| 239 | { |
| 240 | ARM_COMPUTE_UNUSED(thread_count); |
| 241 | |
| 242 | #if defined(ENABLE_FP32_KERNELS) |
| 243 | if (this->_run_method == &add_fp32_neon) |
| 244 | { |
| 245 | size_t mws = ICPPKernel::default_mws; |
| 246 | if (platform.get_cpu_model() == CPUModel::N1) |
| 247 | { |
| 248 | mws = default_mws_N1_fp32_neon; |
| 249 | } |
| 250 | else if (platform.get_cpu_model() == CPUModel::V1) |
| 251 | { |
| 252 | mws = default_mws_V1_fp32_neon; |
| 253 | } |
| 254 | else |
| 255 | { |
| 256 | return ICPPKernel::default_mws; |
| 257 | } |
| 258 | |
| 259 | // tensor is 1D or was re-interpreted as 1D |
| 260 | if (this->window().shape().num_dimensions() == 1) |
| 261 | { |
| 262 | return mws; |
| 263 | } |
| 264 | else |
| 265 | { |
| 266 | // scale mws down by the number of elements along all the dimensions (x, z, w, etc) except the one |
| 267 | // that we parallelize along (the y dimension). This allows for parallelization when the Y_SIZE is small |
| 268 | // but the other sizes are large, which boosts performance. |
| 269 | mws = static_cast<size_t>(mws / (this->window().num_iterations_total() / this->window().num_iterations(1))); |
| 270 | return std::max(static_cast<size_t>(1), mws); |
| 271 | } |
| 272 | } |
| 273 | #else /* ENABLE_FP32_KERNELS */ |
| 274 | ARM_COMPUTE_UNUSED(platform); |
| 275 | #endif /* ENABLE_FP32_KERNELS */ |
| 276 | return ICPPKernel::default_mws; |
| 277 | } |
| 278 | |
| 279 | } // namespace kernels |
| 280 | } // namespace cpu |
nothing calls this directly
no test coverage detected