<div dir="ltr"><div><div>You caught me right as I'm leaving the office, so this reply will be a bit brief until I have time to write something more lengthy...<br><br></div>Generally, the only conventions you need to follow for simple CUDA kernels is to use ptx_kernel as the calling convention, and use address space 1 for global-address pointers.  The generated PTX is consumable by the Driver API (see CUDA samples for using the Driver API for loading/executing PTX kernels).<br>
<br></div>In the near future, I hope to put together a bit of a tutorial on this.  I am well aware that there is a lack of information here, and I hope to correct that soon!<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">
On Tue, Jan 22, 2013 at 3:56 PM, Timothy Baldridge <span dir="ltr"><<a href="mailto:tbaldridge@gmail.com" target="_blank">tbaldridge@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">I'm in the process of writing a library and giving a talk about writing compilers using LLVM (llvm-c) and Clojure. As part of my talk I'd like to give an example of a program running on CUDA. <br><br>

Are there any papers, tutorials, examples, on writing a custom frontend for NVPTX? For instance, I'm trying to figure out how to get access to "global" variables like blockidx. I know that libc won't be accessible  so I'm probably just going to give a demonstration of a image blur filter written in a custom-built programming language<br>

<br>I was going to try simply taking my llvm module and having llvm write out the object file using the nvptx triple. But to be honest here, I'm just shooting in the dark at this point. <br><br>Any information would be greatly appreciated. <span class="HOEnZb"><font color="#888888"><br>

<br>Timothy</font></span></div>
<br>_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br><br><div>Thanks,</div><div><br></div><div>Justin Holewinski</div>
</div>