From 7d91c615b594d5e9abb1753b3f572f64b0581a48 Mon Sep 17 00:00:00 2001 From: SiCong Li Date: Fri, 11 Aug 2023 17:58:56 +0100 Subject: Fix out-of-scope CLBufferMemoryRegion's buffer still in queue issue When a CLBufferMemoryRegion is freed, it also frees its cl::Buffer object. At this point we need to flush the queue to ensure all prior commands that may use this buffer are completed before the buffer's deallocation. Previously a CommandQueue object is owned as a member inside CLBufferMemoryRegion. Whenever CLBufferMemoryRegion is freed it causes the queue to be released, which implicitly flushes the queue. Now we need to explicitly flush the queue, without the excessive releasing of the queue Resolves COMPMID-6492 Signed-off-by: SiCong Li Change-Id: I799507bcff8526d1381cde53d7c6298684c6d3ee Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/10126 Benchmark: Arm Jenkins Tested-by: Arm Jenkins Reviewed-by: Gian Marco Iodice Comments-Addressed: Arm Jenkins --- arm_compute/runtime/CL/CLMemoryRegion.h | 1 + 1 file changed, 1 insertion(+) (limited to 'arm_compute') diff --git a/arm_compute/runtime/CL/CLMemoryRegion.h b/arm_compute/runtime/CL/CLMemoryRegion.h index 690a924f5b..66a30fa56b 100644 --- a/arm_compute/runtime/CL/CLMemoryRegion.h +++ b/arm_compute/runtime/CL/CLMemoryRegion.h @@ -105,6 +105,7 @@ public: * @param[in] buffer Buffer to be used as a memory region */ CLBufferMemoryRegion(const cl::Buffer &buffer); + virtual ~CLBufferMemoryRegion() override; // Inherited methods overridden : void *ptr() final; -- cgit v1.2.1