From e33f8ac9d8b3bd8b376d2306c3988381309b68eb Mon Sep 17 00:00:00 2001 From: Joseph Huber Date: Thu, 23 Mar 2023 11:27:20 -0500 Subject: [PATCH] [libc] Fix inline assembly for nvptx quick_exit Summary: The `exit` function in NVPTX has no intrinsic, but the assembly requires a semicolon in the ptx, otherwise it will fail. --- libc/src/__support/OSUtil/gpu/quick_exit.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libc/src/__support/OSUtil/gpu/quick_exit.cpp b/libc/src/__support/OSUtil/gpu/quick_exit.cpp index 56f0427..3fab438 100644 --- a/libc/src/__support/OSUtil/gpu/quick_exit.cpp +++ b/libc/src/__support/OSUtil/gpu/quick_exit.cpp @@ -27,7 +27,7 @@ void quick_exit(int status) { [](rpc::Buffer *) { /* void */ }); #if defined(LIBC_TARGET_ARCH_IS_NVPTX) - asm("exit" ::: "memory"); + asm("exit;" ::: "memory"); #elif defined(LIBC_TARGET_ARCH_IS_AMDGPU) // This will terminate the entire wavefront, may not be valid with divergent // work items. -- 2.7.4