From 7cb13a11c74ac5e6661d0894155ea7521a7d6a0f Mon Sep 17 00:00:00 2001 From: Pramod Kumbhar Date: Thu, 9 Dec 2021 19:42:51 -0500 Subject: [PATCH] free should happen after omp_target_disassociate_ptr --- coreneuron/gpu/nrn_acc_manager.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/coreneuron/gpu/nrn_acc_manager.cpp b/coreneuron/gpu/nrn_acc_manager.cpp index 1342b3124..8692bfa05 100644 --- a/coreneuron/gpu/nrn_acc_manager.cpp +++ b/coreneuron/gpu/nrn_acc_manager.cpp @@ -82,9 +82,8 @@ void cnrn_target_delete(void* h_ptr, size_t len) { { d_ptr = h_ptr; } - // todo: disassociate first or free first - omp_target_free(d_ptr, device_id); omp_target_disassociate_ptr(h_ptr, device_id); + omp_target_free(d_ptr, device_id); #else throw std::runtime_error("cnrn_target_delete() not implemented without OpenACC/OpenMP and gpu build"); #endif