diff options
author | Giorgio Arena <giorgio.arena@arm.com> | 2018-06-28 15:40:07 +0100 |
---|---|---|
committer | Anthony Barbier <anthony.barbier@arm.com> | 2018-11-02 16:53:36 +0000 |
commit | f3139dde4b93b4ea54e4f3bcd27e639c22a7b6ca (patch) | |
tree | 4b028cf3477e8c8627c733b33df6c97dcd0bd12c /arm_compute/runtime | |
parent | d89940e160bc957d37f93f2bdcf5e11ece4d1906 (diff) | |
download | ComputeLibrary-f3139dde4b93b4ea54e4f3bcd27e639c22a7b6ca.tar.gz |
COMPMID-1334 (Nightly) Fix std::bad_alloc error in 32-bit NEON runs
Change-Id: I412420a4f02225708fcc8f446a5af5a9faf7d0a5
Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/137846
Reviewed-by: Georgios Pinitas <georgios.pinitas@arm.com>
Tested-by: Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'arm_compute/runtime')
-rw-r--r-- | arm_compute/runtime/NEON/AssemblyHelper.h | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/arm_compute/runtime/NEON/AssemblyHelper.h b/arm_compute/runtime/NEON/AssemblyHelper.h index 5801c42684..a62078e842 100644 --- a/arm_compute/runtime/NEON/AssemblyHelper.h +++ b/arm_compute/runtime/NEON/AssemblyHelper.h @@ -159,12 +159,11 @@ using AssemblyKernelGlueS8S32 = AssemblyKernelGlue<int8_t, int32_t>; * @param[out] workspace Tensor to allocate. * @param[in] memory_group Tensor memory group. * @param[in] alignment Workspace memory alignment. - * @param[in] num_threads Number of workspace threads. */ -inline void allocate_workspace(size_t workspace_size, Tensor &workspace, MemoryGroup *memory_group, size_t alignment, unsigned int num_threads) +inline void allocate_workspace(size_t workspace_size, Tensor &workspace, MemoryGroup *memory_group, size_t alignment) { ARM_COMPUTE_ERROR_ON_MSG(workspace_size == 0, "size cannot be 0"); - workspace.allocator()->init(TensorInfo(TensorShape{ (workspace_size + alignment) * num_threads }, 1, DataType::S8), alignment); + workspace.allocator()->init(TensorInfo(TensorShape{ (workspace_size + alignment /* FIXME: remove alignment after COMPMID-1088 */) }, 1, DataType::S8), alignment); if(memory_group != nullptr) { memory_group->manage(&workspace); @@ -213,7 +212,7 @@ inline bool setup_assembly_kernel(const ITensor *a, const ITensor *b, ITensor *d { // Allocate workspace const unsigned int alignment = 4096; - allocate_workspace(workspace_size, workspace, &memory_group, alignment, num_threads); + allocate_workspace(workspace_size, workspace, &memory_group, alignment); asm_glue._workspace = &workspace; } @@ -234,7 +233,7 @@ inline bool setup_assembly_kernel(const ITensor *a, const ITensor *b, ITensor *d // Forcing 128-byte alignment (required by 32-bit kernels) const unsigned int alignment = 128; const size_t B_pretranspose_size = asm_gemm->get_B_pretransposed_array_size(); - allocate_workspace(B_pretranspose_size, B_pretranspose, nullptr, alignment, 1); + allocate_workspace(B_pretranspose_size, B_pretranspose, nullptr, alignment); ARM_COMPUTE_ERROR_ON_NULLPTR(B_pretranspose.buffer()); asm_glue._pretranspose = &B_pretranspose; } |