Replace raw pointers for host_interface with shared_ptr to enable automatic memory handling

[ROCm/rocshmem commit: 1ef2d3a6b7]
This commit is contained in:
avinashkethineedi
2025-01-13 20:11:55 +00:00
parent 9b162d4065
commit 15c5ff048c
3 changed files with 7 additions and 11 deletions
+3 -7
View File
@@ -77,8 +77,9 @@ IPCBackend::IPCBackend(MPI_Comm comm)
bp->heap_ptr = &heap;
/* Initialize the host interface */
host_interface =
new HostInterface(hdp_proxy_.get(), thread_comm, &heap);
host_interface = std::make_shared<HostInterface>(hdp_proxy_.get(),
thread_comm,
&heap);
default_host_ctx = std::make_unique<IPCHostContext>(this, 0);
@@ -117,11 +118,6 @@ IPCBackend::~IPCBackend() {
*/
CHECK_HIP(hipFree(bp->atomic_ret->atomic_base_ptr));
// TODO(Avinash) Free g_ret
// delete host_interface;
// host_interface = nullptr;
/**
* Destroy teams infrastructure
* and team world