CUDA: performance tips and tricks