Oops. Just found out the problem and it’s quite clear from the example code.
some_arr = cuda.to_device(np.array(0))
This will never work as it creates a zero-dimensional array.
Note: @gmarkall pointed out this will work with Numba 0.53.
Of course, it just needs to change to this:
some_arr = cuda.to_device(np.array([0]))