Add a "gridsize" CUDA function to compute blockDim*gridDim in kernels

Similar to the `grid()` convenience function that computes `threadIdx + blockIdx * blockDim` (for 1D or 2D), this patch creates a `gridsize()` convenience function that computes `blockDim * gridDim`, also for 1D or 2D.  This supports a common kernel pattern which allows any grid configuration to loop over an arbitrary amount of input data:

    def example_kernel(input, output):
        n = input.shape[0]
        offset = grid(1)
        stride = gridsize(1)
        for i in range(offset, n, stride):
            output[i] = do_something(input[i])