From 816c14d33d4dbcb731db1fb4dad75e2f92ceb278 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Fri, 6 Dec 2024 10:44:46 -0500 Subject: [PATCH] nir: add printf_abort intrinsic abort() for the gpu, implemented with the printf infrastructure since they go together. Signed-off-by: Alyssa Rosenzweig Reviewed-by: Konstantin Seurer Reviewed-by: Lionel Landwerlin Part-of: --- src/compiler/nir/nir_intrinsics.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/compiler/nir/nir_intrinsics.py b/src/compiler/nir/nir_intrinsics.py index 6e23f6faaaa..3c97bf59984 100644 --- a/src/compiler/nir/nir_intrinsics.py +++ b/src/compiler/nir/nir_intrinsics.py @@ -1281,6 +1281,13 @@ system_value("printf_buffer_address", 1, bit_sizes=[32,64]) # single output buffer, it needs each shader to have its own base identifier # from which each printf is indexed. system_value("printf_base_identifier", 1, bit_sizes=[32]) +# Abort the program, triggering device fault. The invoking thread halts +# immediately. Other threads eventually terminate. +# +# This does not take a payload, payloads should be specified with a preceding +# printf. After lowering, the intrinsic will set an aborted? bit in the printf +# buffer. This avoids a separate abort buffer. +intrinsic("printf_abort") # Mesh shading MultiView intrinsics system_value("mesh_view_count", 1)