2025-05-08 13:39:28 -04:00
|
|
|
.. meta::
|
|
|
|
|
:description: rocSHMEM intra-kernel networking runtime for AMD dGPUs on the ROCm platform.
|
|
|
|
|
:keywords: rocSHMEM, API, ROCm, documentation, HIP, Networking, Communication
|
|
|
|
|
|
|
|
|
|
.. _rocshmem-api-memory-management:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
---------------------------
|
2025-05-13 16:26:28 -04:00
|
|
|
Memory management routines
|
2025-05-08 13:39:28 -04:00
|
|
|
---------------------------
|
|
|
|
|
|
|
|
|
|
ROCSHMEM_MALLOC
|
|
|
|
|
---------------
|
|
|
|
|
|
|
|
|
|
.. cpp:function:: __host__ void *rocshmem_malloc(size_t size)
|
|
|
|
|
|
2025-05-13 16:26:28 -04:00
|
|
|
:param size: Memory allocation size in bytes.
|
|
|
|
|
:returns: A pointer to the allocated memory on the symmetric heap.
|
|
|
|
|
If a valid allocation cannot be made, it returns ``NULL``.
|
2025-05-08 13:39:28 -04:00
|
|
|
|
|
|
|
|
**Description:**
|
2025-05-13 16:26:28 -04:00
|
|
|
This routine allocates memory of ``size`` bytes from the symmetric heap.
|
2025-05-08 13:39:28 -04:00
|
|
|
This is a collective operation and must be called by all PEs.
|
|
|
|
|
|
|
|
|
|
ROCSHMEM_FREE
|
|
|
|
|
-------------
|
|
|
|
|
|
|
|
|
|
.. cpp:function:: __host__ void rocshmem_free(void *ptr)
|
|
|
|
|
|
2025-05-13 16:26:28 -04:00
|
|
|
:param ptr: A pointer to previously allocated memory on the symmetric heap.
|
|
|
|
|
:returns: None.
|
2025-05-08 13:39:28 -04:00
|
|
|
|
|
|
|
|
**Description:**
|
2025-05-13 16:26:28 -04:00
|
|
|
This routine frees a memory allocation from the symmetric heap.
|
|
|
|
|
It is a collective operation and must be called by all PEs.
|