[cfe-dev] Clang and OpenCL - Possible bug?!?
Peter Collingbourne
peter at pcc.me.uk
Tue Oct 1 22:04:27 PDT 2013
On Tue, Oct 01, 2013 at 11:59:38PM -0400, Vincent Mirian wrote:
> Hi,
>
> I downloaded LLVM 3.3 with clang support from
> http://llvm.org/releases/download.html#3.3, and installed it on my machine.
> I also installed the opencl header files.
>
> I'm attempting to compile a simple program as follows:
> #pragma OPENCL EXTENSION cl_khr_fp64 : enable
> #include <CL/cl.h>
> /* Test kernel */
> __kernel void test(__global float *in, __global float *out) {
> int index = get_global_id(0);
> out[index] = 3.14159f * in[index] + in[index];
> }
>
> I'm compiling it with: clang -I/usr/include/CL -std=CL1.2 -x cl test.cl -o
> test.ll
>
> but I get the following error:
> OpenCL/build/Release+Asserts/bin/../lib/clang/3.3/include/emmintrin.h:1355:48:
> error:
> too few elements in vector initialization (expected 2
> elements, have 1)
> return __builtin_shufflevector(__a, (__m128i){ 0 }, 0, 2);
>
> I'm uncertain how to fix it. The error is coming from clang header files.
> The file is parsed correctly in C.
The header CL/cl.h is not designed to be included from OpenCL C -- it
is the header for the OpenCL driver library on the host. You probably
want a standard library for OpenCL C such as libclc.
Thanks,
--
Peter
More information about the cfe-dev
mailing list