Skip to content

[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

Merged
merged 4 commits into from
May 27, 2025

Conversation

npmiller
Copy link
Contributor

@npmiller npmiller commented May 16, 2025

  • 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

- 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`
@npmiller npmiller force-pushed the set-kernel-params branch from 9598ff2 to 226e80e Compare May 20, 2025 14:50
@npmiller npmiller temporarily deployed to WindowsCILock May 20, 2025 14:50 — with GitHub Actions Inactive
@npmiller npmiller marked this pull request as ready for review May 20, 2025 14:51
@npmiller npmiller requested review from a team as code owners May 20, 2025 14:51
@npmiller npmiller requested review from Bensuo and frasercrmck May 20, 2025 14:51
@npmiller npmiller temporarily deployed to WindowsCILock May 20, 2025 15:53 — with GitHub Actions Inactive
@npmiller npmiller temporarily deployed to WindowsCILock May 20, 2025 15:53 — with GitHub Actions Inactive
Copy link
Contributor

@Bensuo Bensuo left a 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]; };
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor

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.

Copy link
Contributor

@frasercrmck frasercrmck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM otherwise

@npmiller
Copy link
Contributor Author

@intel/llvm-gatekeepers this is ready to merge

@sommerlukas sommerlukas merged commit cbcd002 into intel:sycl May 27, 2025
33 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants