Skip to content
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] Remove unnecessary entry point parameter checks #17654

Open
martygrant opened this issue Mar 26, 2025 · 0 comments
Open

[UR] Remove unnecessary entry point parameter checks #17654

martygrant opened this issue Mar 26, 2025 · 0 comments

Comments

@martygrant
Copy link
Contributor

martygrant commented Mar 26, 2025

Feels like it defeats the purpose of a validation layer if the adapters have to implement all the error checking that's in the validation layer, just in case the validation layer isn't enabled? As if a validation layer isn't being used, then i'd imagine that the goal is that the code can run more permanently without the overhead of lots of error checking.

Also I can find at least one other core entry-point that doesn't check the desc for null first: https://github.com/oneapi-src/unified-runtime/blob/main/source/adapters/opencl/sampler.cpp#L142

Regardless, I'd prefer a patch that touched all the UR adapter implementations of urCommandBufferCreateExp and consistently either checked pCommandBufferDesc for null pointer or not. As you've pointed out a few lines up, we sometimes do this and sometimes don't, and that's true for other adapters outside of OpenCL too. So introducing consistency would be a better overall improvement to the codebase.

Originally posted by @EwanC in #17615 (comment)

We should leave checking entry point parameters to the validation layer. We should take a pass at the code base at removing unnecessary checks which will be performed by the validation layer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants