[PATCH] D107492: [clang] Replace asm with __asm__ in cuda header

Jon Chesterfield via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 4 11:38:31 PDT 2021


JonChesterfield created this revision.
JonChesterfield added reviewers: tra, emankov, gtbercea, jdoerfert.
Herald added a subscriber: yaxunl.
JonChesterfield requested review of this revision.
Herald added subscribers: cfe-commits, sstefan1.
Herald added a project: clang.

Asm is a gnu extension for C, so at present -fopenmp -std=c99
and similar fail to compile on nvptx, bug 51344

Changing to `__asm__` or `__asm` works for openmp, all three appear to work
for cuda. Suggesting `__asm__` here as `__asm` is used by MSVC with different
syntax, so this should make for better error diagnostics if the header is
passed to a compiler other than clang.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D107492

Files:
  clang/lib/Headers/__clang_cuda_device_functions.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D107492.364204.patch
Type: text/x-patch
Size: 21430 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210804/a3471124/attachment-0001.bin>


More information about the cfe-commits mailing list