MCPcopy Create free account
hub / github.com/ARM-software/ComputeLibrary / get_mws

Method get_mws

src/cpu/kernels/CpuSubKernel.cpp:160–199  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

158}
159
160size_t CpuSubKernel::get_mws(const CPUInfo &platform, size_t thread_count) const
161{
162 ARM_COMPUTE_UNUSED(thread_count);
163
164#if defined(ENABLE_FP32_KERNELS)
165 if (this->_run_method == &sub_same_neon<float>)
166 {
167 size_t mws = ICPPKernel::default_mws;
168 if (platform.get_cpu_model() == CPUModel::N1)
169 {
170 mws = default_mws_N1_fp32_neon;
171 }
172 else if (platform.get_cpu_model() == CPUModel::V1)
173 {
174 mws = default_mws_V1_fp32_neon;
175 }
176 else
177 {
178 return ICPPKernel::default_mws;
179 }
180
181 // tensor is 1D or was re-interpreted as 1D
182 if (this->window().shape().num_dimensions() == 1)
183 {
184 return mws;
185 }
186 else
187 {
188 // scale mws down by the number of elements along all the dimensions (x, z, w, etc) except the one
189 // that we parallelize along (the y dimension). This allows for parallelization when the Y_SIZE is small
190 // but the other sizes are large, which boosts performance.
191 mws = static_cast<size_t>(mws / (this->window().num_iterations_total() / this->window().num_iterations(1)));
192 return std::max(static_cast<size_t>(1), mws);
193 }
194 }
195#else /* ENABLE_FP32_KERNELS */
196 ARM_COMPUTE_UNUSED(platform);
197#endif /* ENABLE_FP32_KERNELS */
198 return ICPPKernel::default_mws;
199}
200
201Status
202CpuSubKernel::validate(const ITensorInfo *src0, const ITensorInfo *src1, const ITensorInfo *dst, ConvertPolicy policy)

Callers 2

adjust_num_of_windowsMethod · 0.45
schedule_opMethod · 0.45

Calls 4

get_cpu_modelMethod · 0.80
num_iterationsMethod · 0.80
num_dimensionsMethod · 0.45
shapeMethod · 0.45

Tested by

no test coverage detected