Splitting source files between CUDA and CPU code.
Merge pull request #172 from erictzeng/split_cuda

Split source files between CUDA and CPU code. Pave the way for #3 and #122.