Skip to content

[UR] Remove unnecessary entry point parameter checksΒ #17654

@martygrant

Description

@martygrant

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions