[cfe-dev] Clang OpenCL errors and warnings

Enrique González via cfe-dev cfe-dev at lists.llvm.org
Tue May 12 04:40:31 PDT 2020

Hello everyone,

I am using Clang 11 for an OpenCL-SPIRV project.

When I try to convert some OpenCL programs into bytecode, I receive the
following error message in some of them:
'../Programs/kernels/longest/longest_0038.cl:19:5: error: use of type
'double' requires cl_khr_fp64 extension to be enabled
    double const t = 2 * (h + 2);'

Also, I receive some warnings like:
'../Programs/kernels/longest/longest_0038.cl:28:19: warning: incompatible
pointer to integer conversion initializing 'const __private int' with an
expression of type '__global int *' [-Wint-conversion]
        const int v = a + f * 2 + l % v;'

This OpenCL codes are automatically generated by a tool called "clgen" from
github, that I am using as my OpenCL source code database.

This errors and warnings are given because the code is not well written or
because I need to use more flags in my clang command?

I use  this command to convert OpenCL programs into bytecode:
'clang -cc1 -triple spir64 -emit-llvm-bc -finclude-default-header
-cl-single-precision-constant -disable-llvm-passes INPUT.cl -o INPUT.bc'

Thanks in advance.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20200512/7c2f575a/attachment.html>

More information about the cfe-dev mailing list