     }
 }
 
-__device__ long rk_poisson_ptrs(rk_state *state, double lam) {
-    long k;
+__device__ int64_t rk_poisson_ptrs(rk_state *state, double lam) {
+    int64_t k;
     double U, V, slam, loglam, a, b, invalpha, vr, us;
     slam = sqrt(lam);
     loglam = log(lam);


struct poisson_functor {
    template<typename... Args>
    __device__ double operator () (Args&&... args) {
        return rk_poisson(args...);
    }
};

}

void poisson(int generator, intptr_t state, intptr_t out, ssize_t size, intptr_t stream, double lam) {
    kernel_launcher<poisson_functor, int64_t> launcher(size, reinterpret_cast<cudaStream_t>(stream));
    generator_dispatcher(generator, launcher, state, out, size, lam);
}

