CUDA: Fix time measurement

The time should not be taken until copying the data to the GPU starts.
Furthermore, the kernels should finish execution before we take their
execution time.