diff --git a/test/gpu.jl b/test/gpu.jl index 529b160..89ee3f5 100644 --- a/test/gpu.jl +++ b/test/gpu.jl @@ -100,8 +100,10 @@ end ) cache = init(prob, opt_f(n)) sol = solve!(cache; maxiters = 5) - best = minimum(p.best_cost for p in Array(cache.particles)) - @test sol.objective == best + best = argmin(p -> p.best_cost, Array(cache.particles)) + @test sol.u == best.best_position + # host f vs FMA-contracted kernel cost: each n-term sum of squares is within n*eps/2 + @test isapprox(sol.objective, best.best_cost; rtol = length(sol.u) * eps()) end end