aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/NEON/functions/NEGEMM.cpp
diff options
context:
space:
mode:
authorPablo Tello <pablo.tello@arm.com>2018-10-24 15:32:39 +0100
committerGeorgios Pinitas <georgios.pinitas@arm.com>2018-11-09 17:04:04 +0000
commit0cf77981fadb883b97efec112e115450873e64c3 (patch)
tree42592f5dd8721ab8337059df3861e1e2b849399d /src/runtime/NEON/functions/NEGEMM.cpp
parent283fc606dbd9058f636b91350a1c47b97aba1a87 (diff)
downloadComputeLibrary-0cf77981fadb883b97efec112e115450873e64c3.tar.gz
COMPMID-1626: Fixed VGG 16/19 bad_alloc failure.
Some systems don't have enough memory to run the VGG networks, for example on systems with only 2GB memory the VGG example fails throwing a bad_alloc exception. This patch introduces the concept of global memory policy in ACL, the policy is a mechanism which could be used by the library's functions to try to reduce memory consumption on systems with limited memory. In this specific case the VGG examples set the policy to MINIMIZE. The GEMM function checks if the policy is MINIMIZE and in this case does not use the pretransposed weights path as this requires considerable more memory. Change-Id: I53abc3c9c64d045d8306793ffc9d24b28e228b7b
Diffstat (limited to 'src/runtime/NEON/functions/NEGEMM.cpp')
-rw-r--r--src/runtime/NEON/functions/NEGEMM.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/runtime/NEON/functions/NEGEMM.cpp b/src/runtime/NEON/functions/NEGEMM.cpp
index e8bf6732b2..82b9cb80ae 100644
--- a/src/runtime/NEON/functions/NEGEMM.cpp
+++ b/src/runtime/NEON/functions/NEGEMM.cpp
@@ -62,7 +62,14 @@ void NEGEMM::configure(const ITensor *a, const ITensor *b, const ITensor *c, ITe
if(run_optimised)
{
- _asm_glue.configure(a, b, d, alpha, beta, _reshape_b_only_on_first_run);
+ if(MEMInfo::get_policy() == MemoryPolicy::MINIMIZE)
+ {
+ _asm_glue.configure(a, b, d, alpha, beta, false);
+ }
+ else
+ {
+ _asm_glue.configure(a, b, d, alpha, beta, _reshape_b_only_on_first_run);
+ }
ARM_COMPUTE_ERROR_ON(!_asm_glue.is_configured());
}
else