From b7478f7872f05819cfea64f1354486e3a760143e Mon Sep 17 00:00:00 2001 From: Feiyue Chen Date: Thu, 1 Dec 2022 09:37:40 +0800 Subject: [PATCH] Added invalidate handle marco Type: Code Improvement Signed-off-by: Feiyue Chen --- src/tim/vx/tensor.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/tim/vx/tensor.cc b/src/tim/vx/tensor.cc index a0cd749..3d4489b 100644 --- a/src/tim/vx/tensor.cc +++ b/src/tim/vx/tensor.cc @@ -172,6 +172,9 @@ bool TensorImpl::CopyDataFromTensor(void* data) { if (tensor->attr.is_created_from_handle) { void* ptr = NULL; vsi_nn_GetTensorHandle(tensor, &ptr); + #ifdef VSI_INVALIDATE_HANDLE_SUPPORT + vsi_nn_InvalidateHandle(tensor); + #endif if (ptr) { memcpy(data, ptr, tensor_bytes); retn = true;