Skip to content

Commit 42c2257

Browse files
some changes
1 parent b3c76d6 commit 42c2257

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

ext/JumpProcessesKernelAbstractionsExt.jl

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,9 @@ function vectorized_solve(probs, prob::JumpProblem, alg::SimpleTauLeaping;
211211
return ts, us
212212
end
213213

214-
# GPU-compatible Poisson sampling PassthroughRNG
214+
export pois_rand, PassthroughRNG
215+
216+
# GPU-compatible Poisson sampling via PassthroughRNG
215217
struct PassthroughRNG <: AbstractRNG end
216218

217219
rand(rng::PassthroughRNG) = Random.rand()
@@ -300,7 +302,7 @@ function procf(λ, K::Int, s::Float64)
300302
c0 = 1 - b1 + 3 * b2 - 15 * c3
301303

302304
if K < 10
303-
px = -λ
305+
px = -float(λ)
304306
log_py = K * log(λ) - loggamma(K + 1) # log(K!) via loggamma
305307
py = exp(log_py)
306308
else
@@ -337,7 +339,7 @@ rng = Xorshifts.Xoroshiro128Plus()
337339
pois_rand(rng, λ)
338340
339341
# Simple Poisson random on GPU
340-
pois_rand(PassthroughRNG(), λ)
342+
pois_rand(PoissonRandom.PassthroughRNG(), λ)
341343
```
342344
"""
343345
pois_rand(λ) = pois_rand(Random.GLOBAL_RNG, λ)

0 commit comments

Comments
 (0)