From 4297b0703db3f3e9064b55ec6f0eb3a6c9abd463 Mon Sep 17 00:00:00 2001 From: gonzalobg <65027571+gonzalobg@users.noreply.github.com> Date: Tue, 3 Sep 2024 13:44:28 +0200 Subject: [PATCH] Update Memory Model docs for HMM (#2272) * Update Memory Model docs for HMM * Document p2p2NativeAtomicSupported --------- Co-authored-by: Michael Schellenberger Costa --- docs/libcudacxx/extended_api/memory_model.rst | 30 +++++++++++-------- 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/docs/libcudacxx/extended_api/memory_model.rst b/docs/libcudacxx/extended_api/memory_model.rst index dfb6ed6789..6dd4097747 100644 --- a/docs/libcudacxx/extended_api/memory_model.rst +++ b/docs/libcudacxx/extended_api/memory_model.rst @@ -61,33 +61,39 @@ An atomic operation is atomic at the scope it specifies if: - it specifies a scope other than ``thread_scope_system``, **or** - the scope is ``thread_scope_system`` and: - - it affects an object in `unified + - it affects an object in `system allocated memory `__ and `pageableMemoryAccess `__ is ``1`` [0], **or** + - it affects an object in `managed memory `__ and `concurrentManagedAccess `__ is ``1``, **or** - - it affects an object in CPU memory and + - it affects an object in `mapped + memory `__ and `hostNativeAtomicSupported `__ is ``1``, **or** - it is a load or store that affects a naturally-aligned object of sizes ``1``, ``2``, ``4``, ``8``, or ``16`` bytes on `mapped - memory `__, + memory `__ [1], **or** - - it affects an object in GPU memory and only GPU threads access it. + - it affects an object in GPU memory, only GPU threads access it, and + - `p2pNativeAtomicSupported `__ between each accessing GPU and the GPU where the object resides is ``1``, or + - only GPU threads from a single GPU concurrently access it. .. note:: - If `hostNativeAtomicSupported` is `0`, atomic load or store operations at system scope that affect a - naturally-aligned 16-byte wide object in - `unified memory `__ or - `mapped memory `__ require system - support. NVIDIA is not aware of any system that lacks this support and there is no CUDA API query available to - detect such systems. + - [0] If `PageableMemoryAccessUsesHostPagetables `__ is ``0`` then atomic operations to memory mapped file or ``hugetlbfs`` allocations are not atomic. + - [1] If `hostNativeAtomicSupported `__ is ``0``, atomic load or store operations at system scope that affect a + naturally-aligned 16-byte wide object in + `unified memory `__ or + `mapped memory `__ require system + support. NVIDIA is not aware of any system that lacks this support and there is no CUDA API query available to + detect such systems. Refer to the `CUDA programming guide `__ for more information on -`unified memory `__, +`system allocated memory `__, +`managed memory `__, `mapped memory `__, -CPU memory, and GPU peer memory. +CPU memory, and GPU memory. Data Races ----------