diff options
Diffstat (limited to 'arm_compute/runtime')
-rw-r--r-- | arm_compute/runtime/CL/gemm/CLGEMMKernelSelection.h | 65 | ||||
-rw-r--r-- | arm_compute/runtime/CL/gemm/CLGEMMKernelSelectionBifrost.h | 55 | ||||
-rw-r--r-- | arm_compute/runtime/CL/gemm/CLGEMMKernelSelectionMidgard.h | 53 | ||||
-rw-r--r-- | arm_compute/runtime/CL/gemm/CLGEMMKernelSelectionValhall.h | 53 | ||||
-rw-r--r-- | arm_compute/runtime/CL/tuners/CLLWSList.h | 5 | ||||
-rw-r--r-- | arm_compute/runtime/CL/tuners/Tuners.h | 4 | ||||
-rw-r--r-- | arm_compute/runtime/CPP/functions/CPPSplit.h | 5 | ||||
-rw-r--r-- | arm_compute/runtime/CPUUtils.h | 44 | ||||
-rw-r--r-- | arm_compute/runtime/NEON/NEFunctions.h | 1 | ||||
-rw-r--r-- | arm_compute/runtime/NEON/functions/NEConcatenateLayer.h | 2 | ||||
-rw-r--r-- | arm_compute/runtime/NEON/functions/NESimpleAssemblyFunction.h | 56 | ||||
-rw-r--r-- | arm_compute/runtime/SchedulerUtils.h | 39 | ||||
-rw-r--r-- | arm_compute/runtime/Utils.h | 57 |
13 files changed, 11 insertions, 428 deletions
diff --git a/arm_compute/runtime/CL/gemm/CLGEMMKernelSelection.h b/arm_compute/runtime/CL/gemm/CLGEMMKernelSelection.h deleted file mode 100644 index a6bc008103..0000000000 --- a/arm_compute/runtime/CL/gemm/CLGEMMKernelSelection.h +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (c) 2020 Arm Limited. - * - * SPDX-License-Identifier: MIT - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to - * deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ -#ifndef ARM_COMPUTE_CLGEMMKERNELSELECTION_H -#define ARM_COMPUTE_CLGEMMKERNELSELECTION_H - -#include "arm_compute/runtime/CL/ICLGEMMKernelSelection.h" -#include "arm_compute/runtime/CL/gemm/CLGEMMKernelSelectionBifrost.h" -#include "arm_compute/runtime/CL/gemm/CLGEMMKernelSelectionMidgard.h" -#include "arm_compute/runtime/CL/gemm/CLGEMMKernelSelectionValhall.h" - -#include <memory> - -namespace arm_compute -{ -namespace cl_gemm -{ -/** CLGEMMKernelSelection factory class */ -class CLGEMMKernelSelectionFactory final -{ -public: - /** Static method to select the GEMM kernel accordingly with the GPU target and GEMM's dimensionality - * - * @param[in] gpu GPU target - * - * @return CLGEMMKernelSelection class - */ - static std::unique_ptr<ICLGEMMKernelSelection> create(GPUTarget gpu) - { - switch(get_arch_from_target(gpu)) - { - case GPUTarget::MIDGARD: - return support::cpp14::make_unique<CLGEMMKernelSelectionMidgard>(gpu); - case GPUTarget::BIFROST: - return support::cpp14::make_unique<CLGEMMKernelSelectionBifrost>(gpu); - case GPUTarget::VALHALL: - return support::cpp14::make_unique<CLGEMMKernelSelectionValhall>(gpu); - default: - ARM_COMPUTE_ERROR("Not supported GPU target"); - } - } -}; -} // namespace cl_gemm -} // namespace arm_compute -#endif /*ARM_COMPUTE_CLGEMMKERNELSELECTION_H */ diff --git a/arm_compute/runtime/CL/gemm/CLGEMMKernelSelectionBifrost.h b/arm_compute/runtime/CL/gemm/CLGEMMKernelSelectionBifrost.h deleted file mode 100644 index 579bbe32ad..0000000000 --- a/arm_compute/runtime/CL/gemm/CLGEMMKernelSelectionBifrost.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (c) 2020 Arm Limited. - * - * SPDX-License-Identifier: MIT - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to - * deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ -#ifndef ARM_COMPUTE_CLGEMMKERNELSELECTIONBIFROST_H -#define ARM_COMPUTE_CLGEMMKERNELSELECTIONBIFROST_H - -#include "arm_compute/runtime/CL/ICLGEMMKernelSelection.h" - -namespace arm_compute -{ -namespace cl_gemm -{ -/** Bifrost based OpenCL GEMMKernel selection */ -class CLGEMMKernelSelectionBifrost final : public ICLGEMMKernelSelection -{ -public: - /** Constructor - * - * @param[in] gpu GPU target - */ - CLGEMMKernelSelectionBifrost(GPUTarget gpu); - - // Inherited overridden method - CLGEMMKernelType select_kernel(const CLGEMMKernelSelectionParams ¶ms) override; - -private: - CLGEMMKernelType g76_f32(unsigned int m, unsigned int n, unsigned int k, unsigned int b, bool is_rhs_constant); - CLGEMMKernelType g71_f16(unsigned int m, unsigned int n, unsigned int k, unsigned int b, bool is_rhs_constant); - CLGEMMKernelType default_f32(unsigned int m, unsigned int n, unsigned int k, unsigned int b, bool is_rhs_constant); - CLGEMMKernelType default_f16(unsigned int m, unsigned int n, unsigned int k, unsigned int b, bool is_rhs_constant); - CLGEMMKernelType default_q8(unsigned int m, unsigned int n, unsigned int k, unsigned int b, bool is_rhs_constant); -}; -} // namespace cl_gemm -} // namespace arm_compute -#endif /*ARM_COMPUTE_CLGEMMKERNELSELECTIONBIFROST_H */ diff --git a/arm_compute/runtime/CL/gemm/CLGEMMKernelSelectionMidgard.h b/arm_compute/runtime/CL/gemm/CLGEMMKernelSelectionMidgard.h deleted file mode 100644 index 5547731821..0000000000 --- a/arm_compute/runtime/CL/gemm/CLGEMMKernelSelectionMidgard.h +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (c) 2020 Arm Limited. - * - * SPDX-License-Identifier: MIT - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to - * deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ -#ifndef ARM_COMPUTE_CLGEMMKERNELSELECTIONMIDGARD_H -#define ARM_COMPUTE_CLGEMMKERNELSELECTIONMIDGARD_H - -#include "arm_compute/runtime/CL/ICLGEMMKernelSelection.h" - -namespace arm_compute -{ -namespace cl_gemm -{ -/** Midgard based OpenCL GEMMKernel selection */ -class CLGEMMKernelSelectionMidgard final : public ICLGEMMKernelSelection -{ -public: - /** Constructor - * - * @param[in] gpu GPU target - */ - CLGEMMKernelSelectionMidgard(GPUTarget gpu); - - // Inherited overridden method - CLGEMMKernelType select_kernel(const CLGEMMKernelSelectionParams ¶ms) override; - -private: - CLGEMMKernelType default_f32(unsigned int m, unsigned int n, unsigned int k, unsigned int b, bool is_rhs_constant); - CLGEMMKernelType default_f16(unsigned int m, unsigned int n, unsigned int k, unsigned int b, bool is_rhs_constant); - CLGEMMKernelType default_q8(unsigned int m, unsigned int n, unsigned int k, unsigned int b, bool is_rhs_constant); -}; -} // namespace cl_gemm -} // namespace arm_compute -#endif /*ARM_COMPUTE_CLGEMMKERNELSELECTIONMIDGARD_H */ diff --git a/arm_compute/runtime/CL/gemm/CLGEMMKernelSelectionValhall.h b/arm_compute/runtime/CL/gemm/CLGEMMKernelSelectionValhall.h deleted file mode 100644 index 782ef7474d..0000000000 --- a/arm_compute/runtime/CL/gemm/CLGEMMKernelSelectionValhall.h +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (c) 2020 Arm Limited. - * - * SPDX-License-Identifier: MIT - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to - * deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ -#ifndef ARM_COMPUTE_CLGEMMKERNELSELECTIONVALHALL_H -#define ARM_COMPUTE_CLGEMMKERNELSELECTIONVALHALL_H - -#include "arm_compute/runtime/CL/ICLGEMMKernelSelection.h" - -namespace arm_compute -{ -namespace cl_gemm -{ -/** Valhall based OpenCL GEMMKernel selection */ -class CLGEMMKernelSelectionValhall final : public ICLGEMMKernelSelection -{ -public: - /** Constructor - * - * @param[in] gpu GPU target - */ - CLGEMMKernelSelectionValhall(GPUTarget gpu); - - // Inherited overridden method - CLGEMMKernelType select_kernel(const CLGEMMKernelSelectionParams ¶ms) override; - -private: - CLGEMMKernelType default_f32(unsigned int m, unsigned int n, unsigned int k, unsigned int b, bool is_rhs_constant); - CLGEMMKernelType default_f16(unsigned int m, unsigned int n, unsigned int k, unsigned int b, bool is_rhs_constant); - CLGEMMKernelType default_q8(unsigned int m, unsigned int n, unsigned int k, unsigned int b, bool is_rhs_constant); -}; -} // namespace cl_gemm -} // namespace arm_compute -#endif /*ARM_COMPUTE_CLGEMMKERNELSELECTIONVALHALL_H */ diff --git a/arm_compute/runtime/CL/tuners/CLLWSList.h b/arm_compute/runtime/CL/tuners/CLLWSList.h index 7ce10ac220..48f3f3f7c9 100644 --- a/arm_compute/runtime/CL/tuners/CLLWSList.h +++ b/arm_compute/runtime/CL/tuners/CLLWSList.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 Arm Limited. + * Copyright (c) 2019-2020 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -29,7 +29,8 @@ #include "arm_compute/core/Helpers.h" #include "arm_compute/runtime/CL/CLTunerTypes.h" #include "support/ToolchainSupport.h" -#include <memory> + +#include "support/MemorySupport.h" namespace arm_compute { diff --git a/arm_compute/runtime/CL/tuners/Tuners.h b/arm_compute/runtime/CL/tuners/Tuners.h index 274f13d4c3..dd1c62a252 100644 --- a/arm_compute/runtime/CL/tuners/Tuners.h +++ b/arm_compute/runtime/CL/tuners/Tuners.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 Arm Limited. + * Copyright (c) 2018-2020 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -27,6 +27,8 @@ #include "arm_compute/runtime/CL/tuners/BifrostTuner.h" #include "arm_compute/runtime/CL/tuners/MidgardTuner.h" +#include "support/MemorySupport.h" + #include <memory> namespace arm_compute diff --git a/arm_compute/runtime/CPP/functions/CPPSplit.h b/arm_compute/runtime/CPP/functions/CPPSplit.h index 7929f14046..b2b4d07c86 100644 --- a/arm_compute/runtime/CPP/functions/CPPSplit.h +++ b/arm_compute/runtime/CPP/functions/CPPSplit.h @@ -106,7 +106,10 @@ public: // Output auto inizialitation if not yet initialized TensorInfo tmp_output_info = *output->clone(); - auto_init_if_empty(tmp_output_info, input->clone()->set_is_resizable(true).set_tensor_shape(output_shape)); + if(tmp_output_info.tensor_shape().total_size() == 0) + { + tmp_output_info = input->clone()->set_is_resizable(true).set_tensor_shape(output_shape); + } // Update coordinate on axis start_coords.set(axis, axis_offset); diff --git a/arm_compute/runtime/CPUUtils.h b/arm_compute/runtime/CPUUtils.h deleted file mode 100644 index bcc2f666ea..0000000000 --- a/arm_compute/runtime/CPUUtils.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) 2018-2019 Arm Limited. - * - * SPDX-License-Identifier: MIT - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to - * deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ -#ifndef ARM_COMPUTE_RUNTIME_CPU_UTILS_H -#define ARM_COMPUTE_RUNTIME_CPU_UTILS_H - -namespace arm_compute -{ -class CPUInfo; -/** This function will try to detect the CPU configuration on the system and will fill - * the cpuinfo object accordingly to reflect this. - * - * @param[out] cpuinfo @ref CPUInfo to be used to hold the system's cpu configuration. - */ -void get_cpu_configuration(CPUInfo &cpuinfo); -/** Some systems have both big and small cores, this fuction computes the minimum number of cores - * that are exactly the same on the system. To maximize performance the library attempts to process - * workloads concurrently using as many threads as big cores are available on the system. - * - * @return The minumum number of common cores. - */ -unsigned int get_threads_hint(); -} -#endif /* ARM_COMPUTE_RUNTIME_CPU_UTILS_H */ diff --git a/arm_compute/runtime/NEON/NEFunctions.h b/arm_compute/runtime/NEON/NEFunctions.h index 763294e7da..a97fa3b81a 100644 --- a/arm_compute/runtime/NEON/NEFunctions.h +++ b/arm_compute/runtime/NEON/NEFunctions.h @@ -136,7 +136,6 @@ #include "arm_compute/runtime/NEON/functions/NEScale.h" #include "arm_compute/runtime/NEON/functions/NEScharr3x3.h" #include "arm_compute/runtime/NEON/functions/NESelect.h" -#include "arm_compute/runtime/NEON/functions/NESimpleAssemblyFunction.h" #include "arm_compute/runtime/NEON/functions/NESlice.h" #include "arm_compute/runtime/NEON/functions/NESobel3x3.h" #include "arm_compute/runtime/NEON/functions/NESobel5x5.h" diff --git a/arm_compute/runtime/NEON/functions/NEConcatenateLayer.h b/arm_compute/runtime/NEON/functions/NEConcatenateLayer.h index 1d703ae729..82b4517dd3 100644 --- a/arm_compute/runtime/NEON/functions/NEConcatenateLayer.h +++ b/arm_compute/runtime/NEON/functions/NEConcatenateLayer.h @@ -28,8 +28,8 @@ #include "arm_compute/core/NEON/INEKernel.h" #include "arm_compute/core/Types.h" -#include "arm_compute/core/utils/misc/Requires.h" #include "arm_compute/runtime/NEON/INEOperator.h" +#include "support/Requires.h" #include <memory> #include <vector> diff --git a/arm_compute/runtime/NEON/functions/NESimpleAssemblyFunction.h b/arm_compute/runtime/NEON/functions/NESimpleAssemblyFunction.h deleted file mode 100644 index a814802ead..0000000000 --- a/arm_compute/runtime/NEON/functions/NESimpleAssemblyFunction.h +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) 2018-2019 Arm Limited. - * - * SPDX-License-Identifier: MIT - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to - * deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ -#ifndef ARM_COMPUTE_NESIMPLEASSEMBLYFUNCTION_H -#define ARM_COMPUTE_NESIMPLEASSEMBLYFUNCTION_H - -#include "arm_compute/core/NEON/kernels/assembly/INEGEMMWrapperKernel.h" -#include "arm_compute/runtime/IFunction.h" - -#include <memory> - -namespace arm_compute -{ -/** Basic interface for functions which have a single NEON GEMM wrapper kernel to run */ -class NESimpleAssemblyFunction : public IFunction -{ -public: - /** Constructor */ - NESimpleAssemblyFunction(); - - /** Configure the function with the kernel to run - * - * @param[in] kernel GEMM Wrapper kernel configured and ready to run - * - * @note The kernel is expected to have a 1D window. The function will multi-thread this window across the X dimension. - */ - void configure(std::unique_ptr<INEGEMMWrapperKernel> kernel); - - // Inherited methods overridden: - void run() override final; - -protected: - std::unique_ptr<INEGEMMWrapperKernel> _kernel; /**< Kernel to run */ -}; -} //namespace arm_compute -#endif /*ARM_COMPUTE_NESIMPLEASSEMBLYFUNCTION_H */ diff --git a/arm_compute/runtime/SchedulerUtils.h b/arm_compute/runtime/SchedulerUtils.h deleted file mode 100644 index 5a88e039cc..0000000000 --- a/arm_compute/runtime/SchedulerUtils.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) 2020 Arm Limited. - * - * SPDX-License-Identifier: MIT - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to - * deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ -#ifndef ARM_COMPUTE_SCHEDULER_UTILS_H -#define ARM_COMPUTE_SCHEDULER_UTILS_H - -namespace arm_compute -{ -/** Given two dimensions and a maxium number of threads to utilise, calculate the best - * combination of threads that fit in (mutliplied together) max_threads. - * - * This algorithm assumes that work in either of the dimensions is equally difficult - * to compute - * - * @returns [m_nthreads, n_nthreads] A pair of the threads that should be used in each dimension - */ -std::pair<unsigned, unsigned> split_2d(unsigned max_threads, std::size_t m, std::size_t n); -} // namespace arm_compute -#endif /* ARM_COMPUTE_SCHEDULER_UTILS_H */ diff --git a/arm_compute/runtime/Utils.h b/arm_compute/runtime/Utils.h deleted file mode 100644 index 6e36297704..0000000000 --- a/arm_compute/runtime/Utils.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2017-2019 Arm Limited. - * - * SPDX-License-Identifier: MIT - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to - * deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ -#ifndef ARM_COMPUTE_RUNTIME_UTILS_H -#define ARM_COMPUTE_RUNTIME_UTILS_H - -#include "arm_compute/runtime/IRuntimeContext.h" -#include "arm_compute/runtime/Scheduler.h" - -#include <string> - -namespace arm_compute -{ -/** Convert a Scheduler::Type into a string. - * - * @param[in] t @ref Scheduler::Type to be translated to string. - * - * @return The string describing the scheduler type. - */ -const std::string &string_from_scheduler_type(Scheduler::Type t); - -/** Schedules a kernel using the context if not nullptr else uses the legacy scheduling flow. - * - * @param[in] ctx Context to use. - * @param[in] kernel Kernel to schedule. - * @param[in] hints Hints to use. - */ -void schedule_kernel_on_ctx(IRuntimeContext *ctx, ICPPKernel *kernel, const IScheduler::Hints &hints); - -/** Calculate number of stages for parallel implementations - * - * @param[in] input_x_dimension input tensor x dimension - * @param[in] axis axis to be used - */ -unsigned int calculate_number_of_stages_only_x_axis(size_t input_x_dimension, unsigned int axis); -} // namespace arm_compute -#endif /* ARM_COMPUTE_RUNTIME_UTILS_H */ |