Adjustments for better, more standardised CUDA support. May require more tweaking.
mentioned in commit 9dc86ade
merged