[cfe-users] Wrong selection of the assembler for OpenCL targeting nvptx64?

Wilfried Holzke via cfe-users cfe-users at lists.llvm.org
Mon Jun 1 07:02:45 PDT 2020


Hello,

I tried the compilation of an OpenCL file according to 
https://clang.llvm.org/docs/UsersManual.html#opencl-features

 > clang -target nvptx64-unknown-unknown test.cl

But then I get (with "-v"):
------------------------------------------------------------------------
clang version 10.0.0
Target: nvptx64-unknown-unknown
Thread model: posix
InstalledDir: /usr/lib/llvm/10/bin
Found CUDA installation: /opt/cuda, version 10.1
  "/usr/lib/llvm/10/bin/clang-10" -cc1 -triple nvptx64-unknown-unknown 
-S -disable-free -disable-llvm-verifier -discard-value-names 
-main-file-name test.cl -mrelocation-model static -mthread-model posix 
-mframe-pointer=all -fmath-errno -fno-rounding-math -no-integrated-as 
-dwarf-column-info -fno-split-dwarf-inlining -debugger-tuning=gdb -v 
-resource-dir /usr/lib/llvm/10/bin/../../../../lib/clang/10.0.0 
-fno-dwarf-directory-asm -fdebug-compilation-dir 
/home/user/Projects/OpenCL/clang -ferror-limit 19 -fmessage-length 0 
-fgnuc-version=4.2.1 -fobjc-runtime=gcc -fdiagnostics-show-option 
-fcolor-diagnostics -o /tmp/test-402311.s -x cl test.cl
clang -cc1 version 10.0.0 based upon LLVM 10.0.0 default target 
x86_64-pc-linux-gnu
ignoring nonexistent directory "/usr/local/include"
#include "..." search starts here:
#include <...> search starts here:
  /usr/lib/llvm/10/bin/../../../../lib/clang/10.0.0/include
  /usr/include
End of search list.
  "/usr/bin/as" -o /tmp/test-5ba7a6.o /tmp/test-402311.s
/tmp/test-402311.s: Assembler messages:
/tmp/test-402311.s:5: Error: expected quoted string
/tmp/test-402311.s:5: Error: junk at end of line, first unrecognized 
character is `3'
/tmp/test-402311.s:6: Error: unknown pseudo-op: `.target'
/tmp/test-402311.s:7: Error: unknown pseudo-op: `.address_size'
/tmp/test-402311.s:11: Error: unknown pseudo-op: `.visible'
/tmp/test-402311.s:12: Error: unknown pseudo-op: `.param'
/tmp/test-402311.s:13: Error: unknown pseudo-op: `.param'
/tmp/test-402311.s:14: Error: unknown pseudo-op: `.param'
/tmp/test-402311.s:15: Error: junk at end of line, first unrecognized 
character is `)'
/tmp/test-402311.s:16: Error: no such instruction: `{'
/tmp/test-402311.s:17: Error: unknown pseudo-op: `.reg'
/tmp/test-402311.s:18: Error: unknown pseudo-op: `.reg'
/tmp/test-402311.s:20: Error: no such instruction: `ld.param.f32 
%f1,[k_param_0]'
/tmp/test-402311.s:21: Error: no such instruction: `ld.param.u64 
%rd1,[k_param_2]'
/tmp/test-402311.s:22: Error: no such instruction: `ld.shared.f32 
%f2,[%rd1]'
/tmp/test-402311.s:23: Error: no such instruction: `mul.rn.f32 %f3,%f2,%f1'
/tmp/test-402311.s:24: Error: no such instruction: `st.shared.f32 
[%rd1],%f3'
/tmp/test-402311.s:27: Error: junk at end of line, first unrecognized 
character is `}'
clang-10: error: assembler command failed with exit code 1 (use -v to 
see invocation)
------------------------------------------------------------------------

Shouldn't it execute "/opt/cuda/bin/ptxas" instead of "/usr/bin/as"?

regards

   W. Holzke


More information about the cfe-users mailing list