[PATCH] D28080: [Docs][OpenCL] Added OpenCL feature description to user manual.

Pekka Jääskeläinen via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 17 00:00:16 PST 2017

pekka.jaaskelainen requested changes to this revision.
pekka.jaaskelainen added inline comments.
This revision now requires changes to proceed.

Comment at: docs/UsersManual.rst:2065
+     $ clang -cc1 -triple spir64-unknown-unknown -cl-ext=-cl_khr_fp64 test.cl
Is this correct? I cannot make it work:

~/local/stow/llvm-4.0-unpatched-Debug/bin/clang -Xclang -finclude-default-header -emit-llvm -cc1 -triple spir64-unknown-unknown kernel/test_halfs.cl -c -S -o -
clang-4.0: error: unknown argument: '-cc1'
clang-4.0: error: unknown argument: '-triple'
clang-4.0: error: no such file or directory: 'spir64-unknown-unknown'

-target works instead. (But reveals another issue, there's no printf() declaration, should I file a bug?)

~/local/stow/llvm-4.0-unpatched-Debug/bin/clang -Xclang -finclude-default-header -emit-llvm -target spir64-unknown-unknown kernel/test_halfs.cl -c -S -o -
kernel/test_halfs.cl:10:9: warning: implicit declaration of function 'printf' is invalid in C99 [-Wimplicit-function-declaration]
        printf("max(a,b)[0] type=uint2 a=0x15b348c9 b=0xf88e7d07 want=0xf88e7d07 got=%x\n", max_[0]);
kernel/test_halfs.cl:10:9: error: function with no prototype cannot use the spir_function calling convention
1 warning and 1 error generated.

With 3.9 that kernel which calls printf() passes:
/local/stow/llvm-3.9-debug/bin/clang -Xclang -finclude-default-header -emit-llvm -target spir64-unknown-unknown kernel/test_halfs.cl -c -S -o -
; ModuleID = 'kernel/test_halfs.cl'
source_filename = "kernel/test_halfs.cl"
target datalayout = "e-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024"
target triple = "spir64-unknown-unknown"


More information about the cfe-commits mailing list