Update cuda kernels.
Changes
This MR updates our CUDA kernels to work with a later version, compatible with the version in our Py3 environment.
This repeats all changes from !226 (closed) for these files.
Purpose
I intend to split !226 (closed)'s changes into a number of MRs, which won't be functional code versions themselves, but once complete will encompass the full set of changes to upgrade to py3.
This should provide useful code diffs for reviewers.