Skip to content

Commit

Permalink
Native RNG: Fix randn window calculation.
Browse files Browse the repository at this point in the history
  • Loading branch information
maleadt committed Nov 21, 2024
1 parent b7bee72 commit 2775778
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/random.jl
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ function Random.randn!(rng::RNG, A::AnyCuArray{<:Union{AbstractFloat,Complex{<:A

# grid-stride loop
threadId = threadIdx().x
window = widemul(blockDim().x - 1i32, gridDim().x)
window = widemul(blockDim().x, gridDim().x)
offset = widemul(blockIdx().x - 1i32, blockDim().x)
while offset < length(A)
i = threadId + offset
Expand Down Expand Up @@ -129,7 +129,7 @@ function Random.randn!(rng::RNG, A::AnyCuArray{<:Union{AbstractFloat,Complex{<:A

# grid-stride loop
threadId = threadIdx().x
window = widemul(blockDim().x - 1i32, gridDim().x)
window = widemul(blockDim().x, gridDim().x)
offset = widemul(blockIdx().x - 1i32, blockDim().x)
while offset < length(A)
i = threadId + offset
Expand Down

0 comments on commit 2775778

Please sign in to comment.