Fix support for CUDA 5 and Thrust 1.6+.