For the second option, you'll need to use [http://www.swig.org/ SWIG (Simplified Wrapper and Interface Generator)] or something that gives you equivalent functionality for your language, such as [https://cython.org/ Cython] for Python. ([https://github.com/rmcgibbo/npcuda-example NPCUDA] is a simple project to demo both of these methods in Python.) The major advantage of this option is that you aren't hitching your horse to the continued support of a whole series of intermediate APIs.
{{Colored box|Titletitle=Notice for Perl Programmers|Contentcontent=A quick look at the GPU support for Perl suggests that SWIG the way to go!}}
===Compiling a Kernel===