implement os.abort and panic for cuda

This commit is contained in:
Guillaume Wenzek 2022-10-07 14:31:15 +02:00 committed by Andrew Kelley
parent 419855c475
commit 24c749473a
2 changed files with 6 additions and 0 deletions

View File

@ -833,6 +833,7 @@ pub fn default_panic(msg: []const u8, error_return_trace: ?*StackTrace, ret_addr
// Didn't have boot_services, just fallback to whatever.
std.os.abort();
},
.cuda => std.os.abort(),
else => {
const first_trace_addr = ret_addr orelse @returnAddress();
std.debug.panicImpl(error_return_trace, first_trace_addr, msg);

View File

@ -500,10 +500,15 @@ pub fn abort() noreturn {
@breakpoint();
exit(1);
}
if (builtin.os.tag == .cuda) {
@"llvm.trap"();
}
system.abort();
}
extern fn @"llvm.trap"() noreturn;
pub const RaiseError = UnexpectedError;
pub fn raise(sig: u8) RaiseError!void {