Skip to content

Commit e1e6e63

Browse files
authored
Update kernels.jl
1 parent 98c3886 commit e1e6e63

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/kernels.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,9 @@ end
150150
@inbounds gpu_particles[i] = particle
151151
end
152152

153+
# Why you say we need a different code for CPUs for sync version? Turns out
154+
# that you cannot do reduction within a kernel due to some bugs in KA.jl
155+
# https://github.com/JuliaGPU/KernelAbstractions.jl/issues/330
153156
@kernel function update_particle_states!(prob, gpu_particles, gbest, w,
154157
opt::ParallelSyncPSOKernel{Backend, T, G, H}; c1 = 1.4962f0,
155158
c2 = 1.4962f0) where {Backend <: CPU, T, G, H}

0 commit comments

Comments
 (0)