Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Under what circumstances would the physical memory be reachable from another device? I assume this would only be the case if the application used sycl_ext_oneapi_peer_access to enable peer-to-peer access? If that is the case, I think we should word it more explicitly:

If other devices have enabled peer-to-peer access with this device via 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.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@steffenlarsen Thanks for the update. Overall, it looks good to me.
I'd just like to confirm that sycl_ext_oneapi_peer_access only affects the regular allocation (e.g., those returned by sycl::aligned_alloc_device) and doesn't impact virtual memory introduced in this extension. The access mode for virtual memory should only be controlled by the APIs explicitly mentioned in this extension, right?


The returned pointer is equivalent to `reinterpret_cast<void *>(ptr)`.

Expand Down Expand Up @@ -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`
Expand Down