-
Notifications
You must be signed in to change notification settings - Fork 794
Description
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
urCommandBufferCreateExpand consistently either checkedpCommandBufferDescfor 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.