Skip to content

nir: add abort() support atop printf

Alyssa Rosenzweig requested to merge alyssa/mesa:nir/printf-abort into main

To implement assert() in driver CL, we need printf and an abort intrinsic. There are many ways to spec abort(). The implementation here is layered atop of nir_lower_printf, which is a good fit for OpenCL and the proposed device-abort OpenCL extension.

For abort in other APIs, this may not be appropriate, but the requirements for CL aborts are sufficiently different (around message passing, distinguishing internal driver CL aborts from application aborts, etc) that it's not worth overdesigning this. Hence why it's layered atop nir_lower_printf, since this abort will always be used in tandem with this.

!32529 (merged) implements assert() atop this abort support.

This MR contains the core NIR support (and related patches), as well as common code to reduce boilerplate for driver wiring up driver OpenCL printf/abort.

Merge request reports

Loading