Fix cuda 2

Modified version of https://github.com/numba/numba/pull/848
Basically the same but with https://github.com/sklam/numba/commit/0e48dd13ae1f70aa6857394a02cca5328022f609 removed