Hi everybody,<br><br>I am trying to produce ptx code starting from OpenCL C.<br>I am experiencing a problem concerning pointer parameters.<br>Here follows an example:<br><br>kernel void function(__global float* parameter1) {}<br>
<br>NVIDIA NVCC Compiler:<br><br>.entry function(<br>  .param .u32 <b style="color: rgb(255, 0, 0);">.ptr</b> .global .align 4 function_param_0<br>)<br>{<br>  ret;<br>}<br><br>CLANG + LLVM PTX backend<br><br>// (skipping builtin functions definitions)<br>
<br>.entry function (.param .b32 __param_1) // @function<br>{<br><br>// BB#0:                                // %entry<br>  exit;<br>}<br><br>As you can see the code generated by the LLVM backend lacks the kernel parameter attribute<br>
.ptr, required to identify pointers [1]. I can understand that the address space attribute (.global) <br>is not defined since there is no agreement on how to represent them in the IR.<br><br>The command I use to compile is:<br>
clang kernels/<a href="http://parameters.cl">parameters.cl</a> -include ocldef.h -include <a href="http://builtin_functions_ptx.cl">builtin_functions_ptx.cl</a> -ccc-host-triple ptx32 -S -o -<br><br>where ocldef.h contains the definitions of OpenCL vector data types,<br>
<a href="http://builtin_functions_ptx.cl">builtin_functions_ptx.cl</a> is the file provided by Justin in a previous message [2].<br><br>Is this a bug? Or the .ptr attribute is just not supported yet ?<br><br>Thank you<br>
<br>Alberto<br><br>-------------------------<br><br>[1] PTX: Parallel Thread Execution ISA Version 2.3, page 30<br>[2] <a href="http://lists.cs.uiuc.edu/pipermail/cfe-dev/2011-October/017699.html">http://lists.cs.uiuc.edu/pipermail/cfe-dev/2011-October/017699.html</a><br>