Add support for native kernel

This branch add supports for native kernel and do small cleanup in devices.c
It also modifies the build_program prototype since one of our backend device (not yet commited) needs it with user_options.