Skip to content

Commit 2a2b844

Browse files
vchuravymaleadt
authored andcommitted
Try fast linear indexes for KA
1 parent 1389800 commit 2a2b844

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Diff for: src/CUDAKernels.jl

+3-2
Original file line numberDiff line numberDiff line change
@@ -145,9 +145,10 @@ end
145145
end
146146

147147
@device_override @inline function KA.__index_Global_Linear(ctx)
148-
I = @inbounds KA.expand(KA.__iterspace(ctx), blockIdx().x, threadIdx().x)
148+
# I = @inbounds KA.expand(KA.__iterspace(ctx), blockIdx().x, threadIdx().x)
149+
return (blockIdx().x-1) * blockDim().x + threadIdx().x
149150
# TODO: This is unfortunate, can we get the linear index cheaper
150-
@inbounds LinearIndices(KA.__ndrange(ctx))[I]
151+
# @inbounds LinearIndices(KA.__ndrange(ctx))[I]
151152
end
152153

153154
@device_override @inline function KA.__index_Local_Cartesian(ctx)

0 commit comments

Comments
 (0)