Skip to content

Commit d8cb83b

Browse files
committed
Fix for inexact division sizes
1 parent 8168e3e commit d8cb83b

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/kernels.jl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,11 @@ end
6666

6767
group_particles = @localmem SPSOGBest{T1, T2} (gs)
6868

69-
i > length(gpu_particles) && return
69+
if tidx == 1
70+
fill!(group_particles, SPSOGBest(gbest.position, convert(typeof(gbest.cost), Inf)))
71+
end
72+
73+
@synchronize
7074

7175
@inbounds particle = gpu_particles[i]
7276

src/lowerlevel_solve.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ function vectorized_solve!(prob,
88
backend = get_backend(gpu_particles)
99

1010
## TODO: Get dynamic workgroupsize
11-
workgroupsize = (64,)
11+
workgroupsize = (min(length(gpu_particles), 1024),)
1212

1313
update_particle_kernel = update_particle_states!(backend, workgroupsize)
1414

0 commit comments

Comments
 (0)