Skip to content

Commit a48ef07

Browse files
committed
fixup! add backend variable
1 parent 27d91cf commit a48ef07

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

test/Project.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
[deps]
2+
CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba"
23
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
34
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
45
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"

test/gpu.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
include("./utils.jl")
2+
13
Random.seed!(1234)
24

35
## Solving the rosenbrock problem
@@ -16,12 +18,12 @@ prob = OptimizationProblem(rosenbrock, x0, p; lb = lb, ub = ub)
1618

1719
n_particles = 1000
1820

19-
sol = solve(prob, ParallelPSOKernel(n_particles; backend = CUDABackend()), maxiters = 500)
21+
sol = solve(prob, ParallelPSOKernel(n_particles; backend), maxiters = 500)
2022

2123
@test sol.objective < 1e-4
2224

2325
sol = solve(prob,
24-
ParallelSyncPSO(n_particles, CUDABackend()),
26+
ParallelSyncPSO(n_particles, backend),
2527
maxiters = 500)
2628

2729
@test sol.objective < 1e-4

0 commit comments

Comments
 (0)