From 86bd8a58f462ee07920b4bfd58e0905eddbeb1be Mon Sep 17 00:00:00 2001 From: "Larsen, Steffen" Date: Thu, 6 Nov 2025 04:09:59 -0800 Subject: [PATCH 1/3] [SYCL][Docs] Clarify virtual memory accessibility This commit adds wording specifying that access mode applies to all devices in the context for which the corresponding memory is accessible. Signed-off-by: Larsen, Steffen --- .../experimental/sycl_ext_oneapi_virtual_mem.asciidoc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/sycl/doc/extensions/experimental/sycl_ext_oneapi_virtual_mem.asciidoc b/sycl/doc/extensions/experimental/sycl_ext_oneapi_virtual_mem.asciidoc index 72a6e1ed14f55..0408c7b2b3a3d 100644 --- a/sycl/doc/extensions/experimental/sycl_ext_oneapi_virtual_mem.asciidoc +++ b/sycl/doc/extensions/experimental/sycl_ext_oneapi_virtual_mem.asciidoc @@ -296,7 +296,9 @@ for the device associated with this instance of `physical_mem`. If `mode` is `address_access_mode::read` or `address_access_mode::read_write` the returned pointer is accessible after the call as read-only or read-write respectively. Otherwise, it is considered inaccessible and accessing it will -result in undefined behavior. +result in undefined behavior. The accessibility applies to all devices in +the context associated with this instance of `physical_mem` from which the +physical memory is reachable. The returned pointer is equivalent to `reinterpret_cast(ptr)`. @@ -351,7 +353,8 @@ Changes the access mode of a mapped virtual memory range specified by `ptr` and If `mode` is `address_access_mode::read` or `address_access_mode::read_write` `ptr` pointer is accessible after the call as read-only or read-write respectively. Otherwise, it is considered inaccessible and accessing it will -result in undefined behavior. +result in undefined behavior. The accessibility applies to all devices in +`syclContext` from which the memory referenced by `ptr` is reachable. The virtual memory range specified by `ptr` and `numBytes` must be a sub-range of virtual memory ranges previously mapped to `physical_mem`. `ptr` From c73a5f8c670c2837d5abc06917b190145fc017a1 Mon Sep 17 00:00:00 2001 From: "Larsen, Steffen" Date: Sun, 9 Nov 2025 23:10:57 -0800 Subject: [PATCH 2/3] Change wording to reference peer access extension Signed-off-by: Larsen, Steffen --- .../sycl_ext_oneapi_virtual_mem.asciidoc | 21 ++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/sycl/doc/extensions/experimental/sycl_ext_oneapi_virtual_mem.asciidoc b/sycl/doc/extensions/experimental/sycl_ext_oneapi_virtual_mem.asciidoc index 0408c7b2b3a3d..7c8ae5b39e6f7 100644 --- a/sycl/doc/extensions/experimental/sycl_ext_oneapi_virtual_mem.asciidoc +++ b/sycl/doc/extensions/experimental/sycl_ext_oneapi_virtual_mem.asciidoc @@ -71,6 +71,8 @@ device memory while relocating the corresponding memory. == Specification +:peer_access: ../supported/sycl_ext_oneapi_peer_access.asciidoc + === Feature test macro This extension provides a feature-test macro as described in the core SYCL @@ -296,9 +298,13 @@ for the device associated with this instance of `physical_mem`. If `mode` is `address_access_mode::read` or `address_access_mode::read_write` the returned pointer is accessible after the call as read-only or read-write respectively. Otherwise, it is considered inaccessible and accessing it will -result in undefined behavior. The accessibility applies to all devices in -the context associated with this instance of `physical_mem` from which the -physical memory is reachable. +result in undefined behavior. + +If other devices in the context associated with this instance of `physical_mem` +have enabled peer-to-peer access with the device associated with this instance +of `physical_mem` via {peer_access}[sycl_ext_oneapi_peer_access], those other +devices also have access to this mapped memory, and the access mode applies to +accesses from those devices also. The returned pointer is equivalent to `reinterpret_cast(ptr)`. @@ -353,8 +359,13 @@ Changes the access mode of a mapped virtual memory range specified by `ptr` and If `mode` is `address_access_mode::read` or `address_access_mode::read_write` `ptr` pointer is accessible after the call as read-only or read-write respectively. Otherwise, it is considered inaccessible and accessing it will -result in undefined behavior. The accessibility applies to all devices in -`syclContext` from which the memory referenced by `ptr` is reachable. +result in undefined behavior. + +If other devices in `syclContext` have enabled peer-to-peer access with the +device on which the memory referenced by `ptr` resides via +{peer_access}[sycl_ext_oneapi_peer_access], those other devices also have access +to this mapped memory, and the access mode applies to accesses from those +devices also. The virtual memory range specified by `ptr` and `numBytes` must be a sub-range of virtual memory ranges previously mapped to `physical_mem`. `ptr` From 819b1b10e5c18ea28fb4993af89516c6d7ee154e Mon Sep 17 00:00:00 2001 From: "Larsen, Steffen" Date: Sun, 9 Nov 2025 23:13:09 -0800 Subject: [PATCH 3/3] Fix links Signed-off-by: Larsen, Steffen --- .../sycl_ext_oneapi_virtual_mem.asciidoc | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/sycl/doc/extensions/experimental/sycl_ext_oneapi_virtual_mem.asciidoc b/sycl/doc/extensions/experimental/sycl_ext_oneapi_virtual_mem.asciidoc index 7c8ae5b39e6f7..db137a0a34587 100644 --- a/sycl/doc/extensions/experimental/sycl_ext_oneapi_virtual_mem.asciidoc +++ b/sycl/doc/extensions/experimental/sycl_ext_oneapi_virtual_mem.asciidoc @@ -71,8 +71,6 @@ device memory while relocating the corresponding memory. == Specification -:peer_access: ../supported/sycl_ext_oneapi_peer_access.asciidoc - === Feature test macro This extension provides a feature-test macro as described in the core SYCL @@ -302,9 +300,9 @@ result in undefined behavior. If other devices in the context associated with this instance of `physical_mem` have enabled peer-to-peer access with the device associated with this instance -of `physical_mem` via {peer_access}[sycl_ext_oneapi_peer_access], those other -devices also have access to this mapped memory, and the access mode applies to -accesses from those devices also. +of `physical_mem` via link:../supported/sycl_ext_oneapi_peer_access.asciidoc[ +sycl_ext_oneapi_peer_access], those other devices also have access to this +mapped memory, and the access mode applies to accesses from those devices also. The returned pointer is equivalent to `reinterpret_cast(ptr)`. @@ -363,9 +361,9 @@ result in undefined behavior. If other devices in `syclContext` have enabled peer-to-peer access with the device on which the memory referenced by `ptr` resides via -{peer_access}[sycl_ext_oneapi_peer_access], those other devices also have access -to this mapped memory, and the access mode applies to accesses from those -devices also. +link:../supported/sycl_ext_oneapi_peer_access.asciidoc[ +sycl_ext_oneapi_peer_access], those other devices also have access to this +mapped memory, and the access mode applies to accesses from those devices also. The virtual memory range specified by `ptr` and `numBytes` must be a sub-range of virtual memory ranges previously mapped to `physical_mem`. `ptr`