-
Notifications
You must be signed in to change notification settings - Fork 796
[SYCL] Drop UrArray from unit-tests #15014
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
Closed
AlexeySachkov
wants to merge
2
commits into
intel:sycl
from
AlexeySachkov:private/asachkov/drop-urarray-from-unittests
Closed
[SYCL] Drop UrArray from unit-tests #15014
AlexeySachkov
wants to merge
2
commits into
intel:sycl
from
AlexeySachkov:private/asachkov/drop-urarray-from-unittests
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
`UrArray` is a wrapper intended to extend lifetime of mock objects so that native objects referncing mock data can be accessed by SYCL RT without any issues. This commit removes the wrapper to simplify writing unit-tests: essentially there is now one less custom class to care about, collections of properties and entry points are now handled using regular `std::vector` and initializer lists. The cost of this is a slightly more complicated implementation for `UrPropertySet` and `UrImage` that now need to replicate functionality of that extra storage from `UrArray`.
steffenlarsen
approved these changes
Aug 9, 2024
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 LGTM!
AlexeySachkov
added a commit
to AlexeySachkov/llvm
that referenced
this pull request
Oct 4, 2024
This is a first patch in series of detaching unit-test classes from UR names. In a previous attempts to do so (intel#14815) there were concerns about what to do with `UrArray` and this PR is another attempt (see also intel#15014) to do so. This PR renames `UrArray` into `LifetimeExtender` to better communicate its purpose: data structures emitted by the compiler (and therefore used by the runtime) to describe device image and their properties to not store data, but only hold pointers to them. Therefore when we mock those in our unit-tests we need to ensure that their lifetime is long enough to cover the whole test. This is a non-functional change by its spirit, but what used to be `UrArray` is now hidden from writers of unit-tests and the interface is switched to `std::vector` - that is done to hide an implementaiton detail and simplify amount of knowledge required to write unit-tests.
AlexeySachkov
added a commit
that referenced
this pull request
Oct 7, 2024
This is a first patch in series of detaching unit-test classes from UR names. In a previous attempts to do so (#14815) there were concerns about what to do with `UrArray` and this PR is another attempt (see also #15014) to do that. This PR renames `UrArray` into `LifetimeExtender` to better communicate its purpose: data structures emitted by the compiler (and therefore used by the runtime) to describe device image and their properties do not store data, but only hold pointers to them. Therefore when we mock those in our unit-tests we need to ensure that their lifetime is long enough to cover the whole test. This is a non-functional change by its spirit, but what used to be `UrArray` is now hidden from writers of unit-tests and the interface is switched to `std::vector` - that is done to hide an implementation detail and simplify amount of knowledge required to write unit-tests.
|
Superseded by #15604 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
UrArrayis a wrapper intended to extend lifetime of mock objects so that native objects referncing mock data can be accessed by SYCL RT without any issues.This commit removes the wrapper to simplify writing unit-tests: essentially there is now one less custom class to care about, collections of properties and entry points are now handled using regular
std::vectorand initializer lists.The cost of this is a slightly more complicated implementation for
UrPropertySetandUrImagethat now need to replicate functionality of that extra storage fromUrArray.