Add host APIs for querying device ctx and remote heap pointer (#200)

* Add host APIs for querying device ctx and remote heap pointer

* Host API to query device pointer for ROCSHMEM_DEFAULT_CONTEXT,
  this is needed to support dynamic module initialization via device kernel
  library bitcode.
* Host API to query remote symmetric heap pointer that can be used in
  custom device kernel for RMA operations.

* Added rocshmem_ptr implementation within the Host Context class
* Enables pointer retrieval functionality for symmetric data objects
* Copy IPC pointers to host memory in RO host context

---------

Co-authored-by: avinashkethineedi <avinash.kethineedi@amd.com>
This commit is contained in:
Dimple Prajapati
2025-07-24 11:03:03 -07:00
committed by GitHub
parent 42e28835ad
commit 87f99e7ec6
12 changed files with 144 additions and 12 deletions
+7
View File
@@ -300,6 +300,13 @@ rocshmem_ctx_t ROCSHMEM_HOST_CTX_DEFAULT;
backend->heap.free(ptr);
}
__host__ void * rocshmem_ptr(void * dest, int pe){
Context *ctx = reinterpret_cast<Context *>(ROCSHMEM_HOST_CTX_DEFAULT.ctx_opaque);
return ctx->shmem_ptr(dest, pe);
}
[[maybe_unused]] __host__ void rocshmem_reset_stats() {
VERIFY_BACKEND();
backend->reset_stats();