aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/CL/CLTensorAllocator.cpp
diff options
context:
space:
mode:
authorGeorgios Pinitas <georgios.pinitas@arm.com>2018-03-19 19:57:01 +0000
committerAnthony Barbier <anthony.barbier@arm.com>2018-11-02 16:49:16 +0000
commitceff0f9a991b693f568c25b1e0933582301082e7 (patch)
tree3938e9b2151fc6b3d42d2bab9f66efa4709a5da1 /src/runtime/CL/CLTensorAllocator.cpp
parent7db3a30cd15659af75938cd964eebb17a12c6e81 (diff)
downloadComputeLibrary-ceff0f9a991b693f568c25b1e0933582301082e7.tar.gz
COMPMID-1016: Optimize kernel reconfiguration
Optimizes kernel reconfiguration when memory manager is used. Note that this works only if every sub-sequent reconfigurations leads to sizes less than the first one. Change-Id: I08898e99929c3756147a02979b726c2380b6e11d Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/125114 Reviewed-by: Anthony Barbier <anthony.barbier@arm.com> Tested-by: Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'src/runtime/CL/CLTensorAllocator.cpp')
-rw-r--r--src/runtime/CL/CLTensorAllocator.cpp9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/runtime/CL/CLTensorAllocator.cpp b/src/runtime/CL/CLTensorAllocator.cpp
index 705c4edd60..c5524b1ccb 100644
--- a/src/runtime/CL/CLTensorAllocator.cpp
+++ b/src/runtime/CL/CLTensorAllocator.cpp
@@ -24,7 +24,6 @@
#include "arm_compute/runtime/CL/CLTensorAllocator.h"
#include "arm_compute/core/Error.h"
-#include "arm_compute/core/Log.h"
#include "arm_compute/core/TensorInfo.h"
#include "arm_compute/runtime/CL/CLMemoryGroup.h"
#include "arm_compute/runtime/CL/CLScheduler.h"
@@ -58,11 +57,7 @@ void *SVMMemory::allocate(cl_context context, size_t size, cl_svm_mem_flags flag
ARM_COMPUTE_ERROR_ON(_ptr != nullptr);
ARM_COMPUTE_ERROR_ON(size > CL_DEVICE_MAX_MEM_ALLOC_SIZE);
_ptr = clSVMAlloc(context, flags, size, alignment);
- if(_ptr == nullptr)
- {
- ARM_COMPUTE_LOG_INFO_MSG_CORE("Call to clSVMAlloc() failed.");
- }
- else
+ if(_ptr != nullptr)
{
_size = size;
_fine_grain = static_cast<bool>(flags & CL_MEM_SVM_FINE_GRAIN_BUFFER);
@@ -76,9 +71,9 @@ void *CLTensorAllocator::svm_ptr()
void CLTensorAllocator::allocate()
{
- ARM_COMPUTE_ERROR_ON(_buffer.get() != nullptr);
if(_associated_memory_group == nullptr)
{
+ ARM_COMPUTE_ERROR_ON(_buffer.get() != nullptr);
if(_svm_memory.allocate(CLScheduler::get().context()(), CL_MEM_READ_WRITE | CL_MEM_SVM_FINE_GRAIN_BUFFER, info().total_size(), 0) == nullptr)
{
// try at coarse grain svm memory