[libc-commits] [PATCH] D159296: [libc] Support 'assert.h' on the GPU

Joseph Huber via Phabricator via libc-commits libc-commits at lists.llvm.org
Thu Aug 31 12:55:24 PDT 2023


jhuber6 added a comment.

In D159296#4632353 <https://reviews.llvm.org/D159296#4632353>, @JonChesterfield wrote:

> Instead of this bespoke locking stuff, how about
>
>   if (gpu::is_first_lane(mask)) {
>     report_assertion_failure();
>     abort();
>   } else {
>     endpgm();
>   }
>
> ?

`endpgm` on AMDGPU kills the whole wavefront. So you'd need to make sure that the printing and everything is done strictly first.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D159296/new/

https://reviews.llvm.org/D159296



More information about the libc-commits mailing list