Skip to content
This repository was archived by the owner on Mar 20, 2023. It is now read-only.

Commit a8958d1

Browse files
Pramod Kumbharpramodk
Pramod Kumbhar
authored andcommitted
free should happen after omp_target_disassociate_ptr
1 parent f61fa43 commit a8958d1

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

Diff for: coreneuron/gpu/nrn_acc_manager.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,8 @@ void cnrn_target_delete(void* h_ptr, size_t len) {
8383
{
8484
d_ptr = h_ptr;
8585
}
86-
// todo: disassociate first or free first
87-
omp_target_free(d_ptr, device_id);
8886
omp_target_disassociate_ptr(h_ptr, device_id);
87+
omp_target_free(d_ptr, device_id);
8988
#else
9089
throw std::runtime_error("cnrn_target_delete() not implemented without OpenACC/OpenMP and gpu build");
9190
#endif

0 commit comments

Comments
 (0)