aboutsummaryrefslogtreecommitdiff
path: root/src/core/NEON/kernels/arm_gemm/gemm_hybrid.hpp
diff options
context:
space:
mode:
authorJoseph Dobson <joseph.dobson@arm.com>2020-02-11 19:32:11 +0000
committerGian Marco Iodice <gianmarco.iodice@arm.com>2020-05-10 13:34:11 +0000
commit6f8b17dedb7b53b550e6210fd1c78c3a3e086271 (patch)
tree6b040314802ea84f1ae84dda235c1af808863346 /src/core/NEON/kernels/arm_gemm/gemm_hybrid.hpp
parent2886c757389c0ccca20a8689daf8180a730ecbc9 (diff)
downloadComputeLibrary-6f8b17dedb7b53b550e6210fd1c78c3a3e086271.tar.gz
[ONCPUML-7] arm_compute support for ND parallelism
Currently 1D ranges of work are specified by the scheduler via two integers, start and end. This limit opportunities for advance parallelism and scheduling This patch expands the interfaces to allow for ND parallism. `GemmCommon::get_window_size` now returns an `NDRange` specifying the work in N-dimensions rather than with the single integer it used prior (1D) Execute now takes an `NDCoordinate` which specifies an `NDRange` with a start position for that work along with an `NDCoordinate` to specify the thread location In addition to expanding the interface to enable this functionality, we have added the capability to SGEMM when the number of threads is high this has the effective of allowing a much greater degree of parallelism where te problem dimension would previously have limited the number of threads. Change-Id: I3e1a8b7276216627bec4ff6f24ac2147552ea9fb Signed-off-by: Joseph Dobson <joseph.dobson@arm.com> Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/2962 Tested-by: Arm Jenkins <bsgcomp@arm.com> Reviewed-by: Gian Marco Iodice <gianmarco.iodice@arm.com> Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'src/core/NEON/kernels/arm_gemm/gemm_hybrid.hpp')
-rw-r--r--src/core/NEON/kernels/arm_gemm/gemm_hybrid.hpp20
1 files changed, 15 insertions, 5 deletions
diff --git a/src/core/NEON/kernels/arm_gemm/gemm_hybrid.hpp b/src/core/NEON/kernels/arm_gemm/gemm_hybrid.hpp
index c3abb04db7..0cb3160de4 100644
--- a/src/core/NEON/kernels/arm_gemm/gemm_hybrid.hpp
+++ b/src/core/NEON/kernels/arm_gemm/gemm_hybrid.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017-2019 ARM Limited.
+ * Copyright (c) 2017-2020 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -142,8 +142,8 @@ public:
_window_range(iceildiv(args._Msize, strategy::out_height()), _nbatches, iceildiv(_Nsize, _n_block), _nmulti) { }
// Interface implementation - Compulsory functions
- unsigned int get_window_size() const override {
- return _window_range.total_size();
+ ndrange_t get_window_size() const override {
+ return { _window_range.total_size(), 1u, 1u, 1u, 1u, 1u };
}
// This kernel can always be dynamically scheduled.
@@ -151,8 +151,7 @@ public:
return true;
}
- // Execute
- void execute(unsigned int start, unsigned int end, int threadid) override {
+ void execute_1d(unsigned int start, unsigned int end, int threadid) {
UNUSED(threadid);
#ifdef CYCLE_PROFILING
profiler prof;
@@ -215,6 +214,17 @@ public:
}
}
+ // Execute
+ void execute(const ndcoord_t& work_range, const ndcoord_t& thread_locator, int threadid) override {
+ UNUSED(thread_locator);
+
+ const auto start = work_range.get_position(0);
+ const auto size = work_range.get_size(0);
+ const auto stop = start + size;
+
+ execute_1d(start, stop, threadid);
+ }
+
// Interface implementation - pretransposed
bool B_is_pretransposed() const override {
return true;