[OpenMP] Do not define '__assert_fail' if we have the GPU libc (#100409)

Summary:
The C library is intended to provide `__assert_fail`, so in the cases
that we have both we should defer to that. This means that if you build
the C library for GPUs you'll get the RPC based asser, and if not you'll
get the trap based one.
This commit is contained in:
Joseph Huber
2024-07-26 15:18:10 -05:00
committed by GitHub
parent 745aa48165
commit 7ebd97b852
2 changed files with 3 additions and 4 deletions

View File

@@ -26,10 +26,13 @@ using namespace ompx;
extern "C" {
void __assert_assume(bool condition) { __builtin_assume(condition); }
#ifndef OMPTARGET_HAS_LIBC
[[gnu::weak]] void __assert_fail(const char *expr, const char *file,
unsigned line, const char *function) {
__assert_fail_internal(expr, nullptr, file, line, function);
}
#endif
void __assert_fail_internal(const char *expr, const char *msg, const char *file,
unsigned line, const char *function) {
if (msg) {

View File

@@ -2,10 +2,6 @@
// RUN: %fcheck-generic --check-prefix=CHECK
// REQUIRES: libc
// AMDGPU and NVPTX without LTO uses the implementation in OpenMP currently.
// UNSUPPORTED: nvptx64-nvidia-cuda
// UNSUPPORTED: amdgcn-amd-amdhsa
// REQUIRES: gpu
#include <assert.h>