-
Notifications
You must be signed in to change notification settings - Fork 787
[UR][CUDA][HIP] Refactor setKernelParams #18518
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
Conversation
- Remove unused Context parameters - Avoid unnecessary copy in `guessLocalWorkSize` - Simplify the control flow in setKernelParams - Move cached properties fetching code to constructors - Query HIP for occupancy in `guessLocalWorkSize`
9598ff2
to
226e80e
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.
Command-buffer changes LGTM!
int getMaxBlockDimX() const noexcept { return MaxBlockDimX; }; | ||
|
||
int getMaxBlockDimY() const noexcept { return MaxBlockDimY; }; | ||
size_t getMaxBlockDim(int dim) const noexcept { return MaxBlockDim[dim]; }; |
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.
Is noexcept
on something that accesses MaxBlockDim[dim]
correct? Might'nt this technically throw an exception when out of bounds?
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.
It's a size_t
C array not a vector, so I don't believe this would ever throw an exception. Maybe with extra windows bounds checking or something? But even then I'd expect that to be asserting instead.
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.
Yeah perhaps. Unfortunately https://en.cppreference.com/w/cpp/container/language/array.html is down so I can't see the C++ behaviour, but another (less trusted) source said that the out-of-range behaviour on a C-style array is undefined and so I don't know if we can guarantee it won't throw an exception.
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 otherwise
@intel/llvm-gatekeepers this is ready to merge |
guessLocalWorkSize
guessLocalWorkSize