Skip to main content

Module driver

Module driver 

Source
Expand description

Turning a driver’s status code into an error the runtime understands.

The C-family device APIs — the CUDA and HIP runtimes, and the JIT compilers beside them — all answer the same way: an integer, zero for success, an enum of their own otherwise. Every backend over one of them has to turn that into whichever error its caller expects, and doing it by hand at each call site produces one wording per site and, sooner or later, a panic where the neighbours report.

checked is the one answer, and the From implementations are how a ? turns it into whichever error the caller’s signature already promises.

Structs§

DriverError
A driver entry point that failed, named by what was called.

Functions§

checked
Ok when status says the call to op succeeded.