Skip to content

Commit

Permalink
build: Enable gpu precomp if CUDA is functional
Browse files Browse the repository at this point in the history
  • Loading branch information
tmmsartor committed Jul 23, 2024
1 parent 95ff606 commit 57a49a3
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions compiler/generate_precompile.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using MadNLP_C
using Base: unsafe_convert
using Logging
using CUDA

logger = ConsoleLogger(stderr, Logging.Warn)
global_logger(logger)
Expand Down Expand Up @@ -111,12 +112,16 @@ iter::Vector{Int64} = []
primal_feas::Vector{Float64} = []
dual_feas::Vector{Float64} = []


cases::Vector{Tuple{String,Int,Int,Float64}} = [
("umfpack",3,10,1e-6),
("mumps",3,10,1e-4),
("lapack_cpu",3,100,1e-8)
("umfpack",3,10,1e-6),
("mumps",3,10,1e-4),
("lapack_cpu",3,100,1e-8),
]

if CUDA.functional()
push!(cases,("cudss",3,1000,1e-4))
end

for (linear_solver,print_level, max_iter, tol) in cases
nlp_interface = MadnlpCInterface(
@cfunction(eval_f,Cint,(Ptr{Cdouble},Ptr{Cdouble},Ptr{Cvoid})),
Expand Down

0 comments on commit 57a49a3

Please sign in to comment.