<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi Ankur,<div><br></div><div>"int4" is not a valid C/C++ type on its own. Are you missing a #include that typedefs those types, perhaps?</div><div><br></div><div>-Jim<br><div><div>On Apr 25, 2012, at 5:48 PM, ankur deshwal <<a href="mailto:a.s.deshwal@gmail.com">a.s.deshwal@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">Hi all, 
<div><br></div>
<div>I am trying to generate an llvm file from opencl kernel. It recognizes address space qualifiers for openCL like __global. However I get following errors for the types ( int4 etc.. for OpenCL)</div>
<div><br></div>
<div>-- My Simple Kernel ---</div>
<div><br></div>
<div>
<div>__kernel void VectorAdd(__global int4 *c, __global int4 *a, __global int4 *b){<br>    unsigned int idx = get_global_id(0);<br>    c[idx] = a[idx] + b[idx];<br>}<br></div><br></div>
<div>-- Compilation and errors</div>
<div><br></div>
<div>
<div> ../build/Debug+Asserts/bin/clang -x cl -emit-llvm -S <a href="http://vectoradd_post.cl/">vectoradd_post.cl</a> -o vectoradd_post.ll<br>vectoradd_post.cl:1:34: error: unknown type name 'int4'; did you mean 'int'?<br>
__kernel void VectorAdd(__global int4 *c, __global int4 *a, __global int4 *b){<br>                                 ^<br>vectoradd_post.cl:1:52: error: unknown type name 'int4'; did you mean 'int'?<br>__kernel void VectorAdd(__global int4 *c, __global int4 *a, __global int4 *b){<br>
                                                   ^<br>vectoradd_post.cl:1:70: error: unknown type name 'int4'; did you mean 'int'?<br>__kernel void VectorAdd(__global int4 *c, __global int4 *a, __global int4 *b){<br>
                                                                     ^<br>vectoradd_post.cl:2:24: warning: implicit declaration of function 'get_global_id' is invalid in C99 [-Wimplicit-function-declaration]<br>    unsigned int idx = get_global_id(0);<br>
                       ^<br>1 warning and 3 errors generated.<br></div>
<div>.</div>
<div><br></div>
<div>Please let me what am I doing wrong. Also is there any document regarding opencl with clang.</div></div>
<div><br></div>
<div>Thanks and Regards,</div>
<div>Ankur</div>
_______________________________________________<br>cfe-dev mailing list<br><a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev<br></blockquote></div><br></div></body></html>