-
Notifications
You must be signed in to change notification settings - Fork 787
[SYCL][NFC] Pass adapter by reference in backend[_impl] #19187
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
base: sycl
Are you sure you want to change the base?
Conversation
4c31021
to
0ee6f51
Compare
0ee6f51
to
0ed0037
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.
LGTM, just one nit.
switch (Backend) { | ||
case backend::opencl: | ||
return ur::getAdapter<backend::opencl>(); | ||
return *ur::getAdapter<backend::opencl>(); |
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.
Should we add asserts to check that the ptr is not null?
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.
In a subsequent PR, I'll change ur::getAdapter
to return adapter reference as well, so there won't be any potential null ptr deference.
It's a part of larger refactoring effort to pass adapter via reference instead of pointer everywhere in the codebase.
Follow-up of:
#19186
#19184