Multithread programming in CUDA