-
Notifications
You must be signed in to change notification settings - Fork 766
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SYCL][Doc] Introduce test plan for virtual mem extension #15509
base: sycl
Are you sure you want to change the base?
[SYCL][Doc] Introduce test plan for virtual mem extension #15509
Conversation
Functionality provided by the extension is optional and it is only available if | ||
corresponding aspect (`ext_oneapi_virtual_mem`) is supported by a device. | ||
|
||
However, we still need to check that that we return a proper exception (with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
However, we still need to check that that we return a proper exception (with | |
However, we still need to check that we return a proper exception (with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Otherwise LGTM
This test case is intended to check that memory accesses to contiguous | ||
virtual memory ranges are performed correctly. | ||
|
||
A test reserve a number of virtual memory ranges which comprsise a contiguous |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A test reserve a number of virtual memory ranges which comprsise a contiguous | |
A test reserve a number of virtual memory ranges which comprise a contiguous |
- that we can copy _from_ a buffer via accessor _to_ virtual memory | ||
- that we can use `memset` on virtual memory | ||
- that we can use `fill` on virtual memory | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about calling sycl::free
on a virtual memory pointer?
If it's allowed, and the spec does say that it is allowed, then should we also check it has same effect as the unmap function?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it should be an explicit exception in the spec about sycl::free
because the core spec says the pointer must have been allocated using one of the USM allocation functions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree, free
should be excluded by the extension. Maybe add another todo to mention this open?
passed to it contains multiple devices and not every of them have | ||
`ext_oneapi_virtual_mem` aspect | ||
- **TODO**: do we need to check that returned granularity is not bigger than | ||
maximum allocation size on a device? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting question. It's not necessarily guaranteed by the spec, but maybe it would be good to make sure. I would assume the max allocation still applies to these.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall I think this looks reasonable. 👍
APIs results in UB and therefore there is nothing to test. This is probably an | ||
incorrect approach of the spec, because we should be able to perform some checks | ||
and inform user about an error. If/when the spec is updated, this test plan | ||
should be updated as well to cover those new scenarios. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this was intentionally left out to avoid the overhead of calculating these things and requesting information that the user should have already requested. That said, this is not something I expect the user to call 1M times, so maybe the overhead would be fine.
- that we can copy _from_ a buffer via accessor _to_ virtual memory | ||
- that we can use `memset` on virtual memory | ||
- that we can use `fill` on virtual memory | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree, free
should be excluded by the extension. Maybe add another todo to mention this open?
…tension (#15848) Based on the test plan #15509, this PR adds an e2e test checking memory granularities returned by `get_mem_granularity`. --------- Co-authored-by: Alexey Sachkov <[email protected]> Co-authored-by: Marcos Maronas <[email protected]>
…tension (intel#15848) Based on the test plan intel#15509, this PR adds an e2e test checking memory granularities returned by `get_mem_granularity`. --------- Co-authored-by: Alexey Sachkov <[email protected]> Co-authored-by: Marcos Maronas <[email protected]>
…eapi_virtual_mem` extension (intel#15887) Based on the test plan intel#15509, this PR adds an e2e test checking whether virtual memory range can correctly be accessed even if it was re-mapped to a different physical range.
) Based on the test plan #15509, this PR adds an e2e test described as `Basic access from a kernel`. It introduces the `helpers.hpp` common header file, which includes the `GetLCMGranularity` function, to be used in upcoming e2e tests for `sycl_ext_oneapi_virtual_mem` extension. --------- Co-authored-by: Alexey Sachkov <[email protected]> Co-authored-by: Steffen Larsen <[email protected]>
…irtual_mem` extension (#15988) Based on the test plan #15509, this PR adds an e2e test that performs following checks: - A check should be performed that we can successfully perform and immediately release a valid reservation of virtual memory. - A check should be performed that methods `get_context()`, `get_device()` and `size()` return correct values (i.e. ones which were passed to physical_mem constructor). - A check should be performed that a value returned from a valid call to `map()` is the same as `reinterpret_cast<void *>(ptr)`. - A check should be performed that we can change access mode of a virtual memory range and immediately see it changed. - A check should be performed that we can successfully map and immediately unmap a virtual memory range.
…em` extension (#15974) Based on the test plan #15509, this PR adds an E2E test to ensure that USM APIs also accept the pointer to virtual memory. --------- Co-authored-by: Udit Agarwal <[email protected]>
No description provided.