diff options
Diffstat (limited to 'src/cpu/CpuContext.cpp')
-rw-r--r-- | src/cpu/CpuContext.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/cpu/CpuContext.cpp b/src/cpu/CpuContext.cpp index 6ff35602f3..d62c1b6310 100644 --- a/src/cpu/CpuContext.cpp +++ b/src/cpu/CpuContext.cpp @@ -24,6 +24,7 @@ #include "src/cpu/CpuContext.h" #include "arm_compute/core/CPP/CPPTypes.h" +#include "src/cpu/CpuTensor.h" #include "src/runtime/CPUUtils.h" #include <cstdlib> @@ -185,5 +186,15 @@ AllocatorWrapper &CpuContext::allocator() { return _allocator; } + +ITensorV2 *CpuContext::create_tensor(const AclTensorDescriptor &desc, bool allocate) +{ + CpuTensor *tensor = new CpuTensor(this, desc); + if(tensor != nullptr && allocate) + { + tensor->allocate(); + } + return tensor; +} } // namespace cpu } // namespace arm_compute |