Skip to content

Commit

Permalink
Allow scalar for comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
avik-pal committed Nov 5, 2023
1 parent 2afc31d commit d1509e6
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions test/gpu/cuda.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
using LinearSolve, CUDA, LinearAlgebra, SparseArrays
using Test

CUDA.allowscalar(false)

n = 8
A = Matrix(I, n, n)
b = ones(n)
Expand All @@ -25,19 +27,19 @@ function test_interface(alg, prob1, prob2)
x2 = prob2.u0

y = solve(prob1, alg; cache_kwargs...)
@test Array(A1 * y) Array(b1)
@test CUDA.@allowscalar(Array(A1 * y) Array(b1))

cache = SciMLBase.init(prob1, alg; cache_kwargs...) # initialize cache
solve!(cache)
@test Array(A1 * cache.u) Array(b1)
@test CUDA.@allowscalar(Array(A1 * cache.u) Array(b1))

cache.A = copy(A2)
solve!(cache)
@test Array(A2 * cache.u) Array(b1)
@test CUDA.@allowscalar(Array(A2 * cache.u) Array(b1))

cache.b = copy(b2)
solve!(cache)
@test Array(A2 * cache.u) Array(b2)
@test CUDA.@allowscalar(Array(A2 * cache.u) Array(b2))

return
end
Expand Down

0 comments on commit d1509e6

Please sign in to comment.