<div dir="ltr"><div><div><div><div>Hi,<br><br></div>My goal is to use Clang/LLVM/libclc to compile an OpenCL kernel and eventually generate a PTX code. I already did this but I am not sure if the PTX code I am generating is correct (is the one that is supposed to be generated).<br><br></div>For example, currently, <br><br></div>In OpenCL : get_global_id(0)   translates to <br></div><div>In LLVM    :  %call = tail call i32 @get_global_id(i32 0)  which translates to<br></div><div>In PTX:<br><br>        // .globl       blur2d<br>.func  (.param .b32 func_retval0) get_global_id<br>(<br>        .param .b32 get_global_id_param_0<br>)<br>;<br><br>         mov.u32         %r2, 0;<br>        .param .b32 param0;<br>        st.param.b32    [param0+0], %r2;<br>        .param .b32 retval0;<br>        call.uni (retval0),<br>        get_global_id,<br>        (<br>        param0<br>        );<br><br><br><br><br></div><div>Is this what is supposed to happen ? or there is something wrong ?  I am saying this because the get_global_id implementation does not make much sense to me and I am not sure if it used the libclc definitions at all ?<br><br></div><div>If it is not, any idea how the correct conversion will look like ? <br><br></div><div>Thanks,<br><br></div></div>