def mc_integrator_kernel(out, rng_states, lower_lim, upper_lim):
            """
            kernel to draw random samples and evaluate the function to
            be integrated at those sample values
            """
            size = len(out)

            gid = cuda.grid(1)
            if gid < size:
                # draw a sample between 0 and 1 on this thread
                samp = xoroshiro128p_uniform_float32(rng_states, gid)

                # normalize this sample to the limit range
                samp = samp * (upper_lim - lower_lim) + lower_lim

                # evaluate the function to be
                # integrated at the normalized
                # value of the sample
                y = func(samp)
                out[gid] = y

            kernel to draw random samples and evaluate the function to
            be integrated at those sample values
            
numba/cuda/tests/doc_examples/test_montecarlo.py