Device code to header files

Signed-off-by: Andrey Shamis <lolnik@gmail.com>