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

Method get_mws

src/cpu/kernels/CpuMulKernel.cpp:1729–1780  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1727}
1728
1729size_t CpuMulKernel::get_mws(const CPUInfo &platform, size_t thread_count) const
1730{
1731 ARM_COMPUTE_UNUSED(thread_count);
1732
1733#if defined(ENABLE_FP32_KERNELS)
1734 if (this->_func_float == &mul_F32_F32_F32)
1735 {
1736 size_t mws = ICPPKernel::default_mws;
1737 if (platform.get_cpu_model() == CPUModel::N1)
1738 {
1739 mws = default_mws_N1_fp32_neon;
1740 }
1741 else if (platform.get_cpu_model() == CPUModel::V1)
1742 {
1743 mws = default_mws_V1_fp32_neon;
1744 }
1745 else
1746 {
1747 if (_split_dimension == Window::DimX)
1748 {
1749 // Don't split the work load too small if the tensor has been reinterpreted as 1D.
1750 // This number is loosely chosen as threading overhead in each platform varies wildly.
1751 return default_mws_other_platforms_1d_tensor;
1752 }
1753 return default_mws;
1754 }
1755
1756 // tensor is 1D or was re-interpreted as 1D
1757 if (this->window().shape().num_dimensions() == 1)
1758 {
1759 return mws;
1760 }
1761 else
1762 {
1763 // scale mws down by the number of elements along all the dimensions (x, z, w, etc) except the one
1764 // that we parallelize along (the y dimension). This allows for parallelization when the Y_SIZE is small
1765 // but the other sizes are large, which boosts performance.
1766 mws = static_cast<size_t>(mws / (this->window().num_iterations_total() / this->window().num_iterations(1)));
1767 return std::max(static_cast<size_t>(1), mws);
1768 }
1769 }
1770#else /* ENABLE_FP32_KERNELS */
1771 ARM_COMPUTE_UNUSED(platform);
1772#endif /* ENABLE_FP32_KERNELS */
1773 if (_split_dimension == Window::DimX)
1774 {
1775 // Don't split the work load too small if the tensor has been reinterpreted as 1D.
1776 // This number is loosely chosen as threading overhead in each platform varies wildly.
1777 return default_mws_other_platforms_1d_tensor;
1778 }
1779 return default_mws;
1780}
1781
1782Status CpuMulKernel::validate(const ITensorInfo *src1,
1783 const ITensorInfo *src2,

Callers

nothing calls this directly

Calls 4

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

Tested by

no test coverage detected