re-implement CUDA threads in one dimension