-
Notifications
You must be signed in to change notification settings - Fork 111
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
[UR] Add lifetime validation to validation layer #1121
Conversation
43c1f19
to
93a709c
Compare
Codecov ReportAttention:
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## main #1121 +/- ##
==========================================
- Coverage 15.36% 15.33% -0.04%
==========================================
Files 240 241 +1
Lines 34182 34820 +638
Branches 3788 3989 +201
==========================================
+ Hits 5252 5339 +87
- Misses 28879 29430 +551
Partials 51 51 ☔ View full report in Codecov by Sentry. |
65d5318
to
07e1009
Compare
07e1009
to
9f5ced0
Compare
6f797f1
to
4487664
Compare
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.
right now this checks whether the provided ptr is a valid ptr to something, not necessarily an object of the expected type. Shouldn't be too hard to add?
scripts/core/INTRO.rst
Outdated
@@ -256,6 +256,8 @@ Layers currently included with the runtime are as follows: | |||
- Enables non-adapter-specific parameter validation (e.g. checking for null values). | |||
* - UR_LAYER_LEAK_CHECKING | |||
- Performs some leak checking for API calls involving object creation/destruction. | |||
* - UR_LAYER_LIFETIME_VALIDATION | |||
- Performs lifetime validation on objects used in API calls. Requires UR_LAYER_LEAK_CHECKING. |
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.
please explain what "lifetime validation" is.
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've added an explanation, take a look.
4487664
to
7dbacd7
Compare
I've added |
e72dc55
to
510bd27
Compare
|
||
void SetUp() { | ||
valAdaptersTest::SetUp(); | ||
adapter = adapters[0]; // TODO - which to choose? |
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.
the way the tests are run there will only ever be one adapter. so [0] is fine.
I think that's fine. If you want to do this, one approach might be to pass the type name as a string from the generated layer to the class with runtime info. Would allow you to do away with typeindex and get correct type names. Not sure if it's worth it. |
b79dbdd
to
8b686dc
Compare
952ba35
to
57d0a47
Compare
57d0a47
to
8540c10
Compare
7eac656
to
b160633
Compare
scripts/core/common.yml
Outdated
@@ -102,7 +102,7 @@ name: "$x_kernel_handle_t" | |||
--- #-------------------------------------------------------------------------- | |||
type: handle | |||
desc: "Handle of a queue object" | |||
class: $xPlatform | |||
class: $xQueue |
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.
this needs to be moved into another PR. Otherwise this one lgtm and we can merge it.
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.
Done. The queue fix is here #1285.
fd803c8
to
a08fc85
Compare
925c5e8
to
51be719
Compare
e8dd668
to
1ba7c7b
Compare
The leak checking feature has been expanded to include handles obtained via the ...Get() functions.
Match files in leak checking tests also account for the ..Create(), ..Get() and ..Release() functions used in test setups.
... handle type checks.
1ba7c7b
to
c0f0a70
Compare
... and refactor the validation layer mako template.
Relies on: #1029.
Solves: #867.