For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /max/get-started.md).
Mojo function
shmem_free
shmem_free[dtype: DType, //](ptr: UnsafePointer[Scalar[dtype], MutExternalOrigin])
Collectively deallocate symmetric memory.
The shmem_free routine is a collective operation on the world team that causes the block to which ptr points to be deallocated, that is, made available for further allocation. If ptr is a null pointer, no action is performed; otherwise, shmem_free calls a barrier on entry. It is the user’s responsibility to ensure that no communication operations involving the given memory block are pending on other communication contexts prior to calling shmem_free. The value of the ptr argument must be identical on all PEs; otherwise, the behavior is undefined.
Parameters:
- dtype (
DType): The data type of the memory being freed.
Args:
- ptr (
UnsafePointer[Scalar[dtype], MutExternalOrigin]): Symmetric address of an object in the symmetric heap.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!