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

Commit

Permalink
free should happen after omp_target_disassociate_ptr
Browse files Browse the repository at this point in the history
  • Loading branch information
Pramod Kumbhar committed Dec 10, 2021
1 parent afc45bf commit 7cb13a1
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions coreneuron/gpu/nrn_acc_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7cb13a1

Please sign in to comment.