Skip to content

Commit

Permalink
device-rng: Remove at-inbounds
Browse files Browse the repository at this point in the history
  • Loading branch information
jpsamaroo committed Mar 29, 2023
1 parent 2439b9d commit 5e4216f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/device/random.jl
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,11 @@ end
warpId = (threadId - Int32(1)) >> 0x6 + Int32(1) # fld1 by 64

if field === :seed
@inbounds global_random_seed()[1]
global_random_seed()[1]
elseif field === :key
@inbounds global_random_keys()[warpId]
global_random_keys()[warpId]
elseif field === :ctr1
@inbounds global_random_counters()[warpId]
global_random_counters()[warpId]
elseif field === :ctr2
blockId = workgroupIdx().x + (workgroupIdx().y - Int32(1)) * gridGroupDim().x +
(workgroupIdx().z - Int32(1)) * gridGroupDim().x * gridGroupDim().y
Expand All @@ -89,9 +89,9 @@ end
warpId = (threadId - Int32(1)) >> 0x6 + Int32(1) # fld1 by 64

if field === :key
@inbounds global_random_keys()[warpId] = x
global_random_keys()[warpId] = x
elseif field === :ctr1
@inbounds global_random_counters()[warpId] = x
global_random_counters()[warpId] = x
end
end

Expand Down

0 comments on commit 5e4216f

Please sign in to comment.