[libc] Fix inline assembly for nvptx quick_exit
authorJoseph Huber <jhuber6@vols.utk.edu>
Thu, 23 Mar 2023 16:27:20 +0000 (11:27 -0500)
committerJoseph Huber <jhuber6@vols.utk.edu>
Thu, 23 Mar 2023 16:28:33 +0000 (11:28 -0500)
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

index 56f0427..3fab438 100644 (file)
@@ -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.