1. A method of compiling source code, said method comprising: accessing a portion of device source code from a file comprising device source code and host source code, wherein said device source code is distinguished from said host source code based on a pre-determined syntax associated with said device source code; determining whether said portion of said device source code comprises kernel to be launched on a device from said device, wherein said device is a graphics processing unit (GPU), and wherein a number of threads in a thread block and a number of thread blocks are specified when the kernel is launched; determining a plurality of application programming interface (API) calls based on said kernel be launched on said device; determining whether said kernel to be launched on said device accesses a private resource; and generating compiled code based on said plurality of API calls, wherein a first portion of said compiled code is operable to execute on a central processing unit (CPU) and a second portion of said compiled code is operable to execute on said device, wherein said second portion of said compiled code is operable to launch said kernel on said device from said device.