cuda code structure

still cannot be compiled
remove unnecessary things

using gettimeofday instead, move other c and c++ things
[FINAL COMMIT] fixed an ugly race condition in the kernel that lead to other results each time the program was run