Memory management routines#
ROCSHMEM_MALLOC#
-
__host__ void *rocshmem_malloc(size_t size)#
- Parameters:
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.
Description:
This routine allocates memory of size bytes from the symmetric heap.
This is a collective operation and must be called by all PEs.
ROCSHMEM_FREE#
-
__host__ void rocshmem_free(void *ptr)#
- Parameters:
ptr – A pointer to previously allocated memory on the symmetric heap.
- Returns:
None.
Description: This routine frees a memory allocation from the symmetric heap. It is a collective operation and must be called by all PEs.
ROCSHMEM_BUFFER_REGISTER#
-
__host__ int rocshmem_buffer_register(void *addr, size_t length);#
- Parameters:
addr – Pointer to previously allocated memory
length – Length of addr
- Returns:
ROCSHMEM_SUCCESS or an error.
Description: Registers a user-allocated buffer. This buffer can be used as a local buffer to most rocSHMEM communication calls. It is erroneous to use it for a remote buffer. Currently, this call is only implemented for IPC and RO, GDA is not supported.
ROCSHMEM_BUFFER_UNREGISTER#
-
__host__ int rocshmem_buffer_unregister(void *addr);#
- Parameters:
addr – Pointer to previously registered memory
- Returns:
ROCSHMEM_SUCCESS or an error.
Description: Deregisters a previously registered buffer that was registered using rocshmem_buffer_register. Currently, this call is only implemented for IPC and RO, GDA is not supported.