[llvm-bugs] [Bug 40707] New: OpenCL frontend fails to compile llvm clc headers with -cl-std=c++

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Feb 12 14:21:42 PST 2019


https://bugs.llvm.org/show_bug.cgi?id=40707

            Bug ID: 40707
           Summary: OpenCL frontend fails to compile llvm clc headers with
                    -cl-std=c++
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: OpenCL
          Assignee: unassignedclangbugs at nondot.org
          Reporter: drohr at jwdt.org
                CC: anastasia.stulova at arm.com, llvm-bugs at lists.llvm.org

Compiling OpenCL code with clang requires the headers from libclc library.
Otherwise, e.g. 
__kernel void test()
{
    int i = get_global_id(0);
}
yields: "implicit declaration of function 'get_global_id' is invalid in OpenCL"

Including the clc headers via
#include <clc/clc.h>
works correctly with -cl-std=CL2.0 and defines the required symbols (such as
get_global_id), but it gives plenty of compile errors with -cl-std=c++,
starting with:
/usr/include/clc/math/fract.inc:23:62: error: unknown type name 'global'
_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE fract(__CLC_GENTYPE x, global
__CLC_GENTYPE *iptr);

For reference, I am using the master branch of libclc from
http://libclc.llvm.org/

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20190212/d89b3060/attachment.html>


More information about the llvm-bugs mailing list