[cfe-dev] Clang and OpenCL - Possible bug?!?

Vincent Mirian vince.mirian at gmail.com
Tue Oct 1 20:58:08 PDT 2013


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.

My goal is to compile a opencl program with clang with LLVM to get the
SPIR. The target processor is a microblaze (mblaze).

Any help would be appreciated to solve this issue. Thanks,

-- 
Vincent Mirian
PhD Candidate
Electrical and Computer Engineering
University of Toronto

Eco-Tip: Save trees! Do you really need to print this email? ;-)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20131001/ad005c14/attachment.html>


More information about the cfe-dev mailing list