diff --git a/Manifest.toml b/Manifest.toml index 35f3f44..7f7d0a8 100644 --- a/Manifest.toml +++ b/Manifest.toml @@ -2,7 +2,7 @@ julia_version = "1.12.2" manifest_format = "2.0" -project_hash = "54309def7c908068951b3458be89fae48b84f475" +project_hash = "bafeb480db5d158cbd64df5b52603b3abbbce294" [[deps.ArgTools]] uuid = "0dad84c5-d112-42e6-8d28-ef12dabb789f" @@ -96,6 +96,12 @@ deps = ["Artifacts", "Libdl"] uuid = "e66e0078-7015-5450-92f7-15fbd957f2ae" version = "1.3.0+1" +[[deps.CuPDLPx]] +deps = ["CUDA_Runtime_jll", "CUDA_SDK_jll", "Clang", "MathOptInterface", "Test", "cuPDLPx_jll"] +path = "." +uuid = "bcd6524d-1420-4b17-a582-359cb8a71a63" +version = "0.2.3" + [[deps.Dates]] deps = ["Printf"] uuid = "ade2ca70-3891-5945-98fb-dc099432e06a" @@ -456,12 +462,6 @@ deps = ["Libdl"] uuid = "83775a58-1f1d-513f-b197-d71354ab007a" version = "1.3.1+2" -[[deps.cuPDLPx]] -deps = ["CUDA_Runtime_jll", "CUDA_SDK_jll", "Clang", "MathOptInterface", "Test", "cuPDLPx_jll"] -path = "." -uuid = "bcd6524d-1420-4b17-a582-359cb8a71a63" -version = "0.2.2" - [[deps.cuPDLPx_jll]] deps = ["Artifacts", "CUDA_Runtime_jll", "CompilerSupportLibraries_jll", "JLLWrappers", "Libdl", "TOML", "Zlib_jll"] git-tree-sha1 = "771249e3a2ed4d173324c8d3cde388ab0fe01bda" diff --git a/Project.toml b/Project.toml index f831466..a6dc3e0 100644 --- a/Project.toml +++ b/Project.toml @@ -1,4 +1,4 @@ -name = "cuPDLPx" +name = "CuPDLPx" uuid = "bcd6524d-1420-4b17-a582-359cb8a71a63" version = "0.2.3" diff --git a/README.md b/README.md index f943e8e..ec2473e 100644 --- a/README.md +++ b/README.md @@ -1,35 +1,35 @@ -# cuPDLPx.jl -Julia interface for cuPDLPx. +# CuPDLPx.jl +Julia interface for [cuPDLPx](https://github.com/MIT-Lu-Lab/cuPDLPx). ## Installation -cuPDLPx.jl is available from the Julia General registry: +CuPDLPx.jl is available from the Julia General registry: ```julia -pkg> add cuPDLPx +pkg> add CuPDLPx ``` ## Use with JuMP -To use cuPDLPx with JuMP, use `cuPDLPx.Optimizer`: +To use CuPDLPx with JuMP, use `CuPDLPx.Optimizer`: ```julia -using JuMP, cuPDLPx -model = Model(cuPDLPx.Optimizer) +using JuMP, CuPDLPx +model = Model(CuPDLPx.Optimizer) ``` ## Setting solver parameters -cuPDLPx.jl supports setting solver parameters via `set_optimizer_attribute`. +CuPDLPx.jl supports setting solver parameters via `set_optimizer_attribute`. ```Julia using JuMP -using cuPDLPx +using CuPDLPx model = read_from_file("2club200v15p5scn.mps.gz") undo = relax_integrality(model) println("Read MPS succeed.") -set_optimizer(model, cuPDLPx.Optimizer) +set_optimizer(model, CuPDLPx.Optimizer) set_optimizer_attribute(model, "verbose", true) set_optimizer_attribute(model, "l_inf_ruiz_iterations", 0) diff --git a/gen/generate.jl b/gen/generate.jl index 99e0ae0..7e9e524 100644 --- a/gen/generate.jl +++ b/gen/generate.jl @@ -19,9 +19,9 @@ ctx = create_context(headers, args, options) ctx.options["is_function_allowed"] = (cursor, spelling) -> startswith(spelling, "cupdlpx_") -output_file = joinpath(@__DIR__, "src", "LibcuPDLPx.jl") +output_file = joinpath(@__DIR__, "src", "LibCuPDLPx.jl") mkpath(dirname(output_file)) build!(ctx) -println("✅ Successfully generated LibcuPDLPx.jl at $(output_file)") +println("✅ Successfully generated LibCuPDLPx.jl at $(output_file)") diff --git a/gen/generate.toml b/gen/generate.toml index ca811fe..c8c3d25 100644 --- a/gen/generate.toml +++ b/gen/generate.toml @@ -1,7 +1,7 @@ [general] library_name = "libcupdlpx" -output_file_path = "./src/LibcuPDLPx.jl" -module_name = "LibcuPDLPx" +output_file_path = "./src/LibCuPDLPx.jl" +module_name = "LibCuPDLPx" jll_pkg_name = "cuPDLPx_jll" use_julia_native_enum_type = true extract_c_comment_style = "doxygen" diff --git a/src/CuPDLPx.jl b/src/CuPDLPx.jl new file mode 100644 index 0000000..71d049b --- /dev/null +++ b/src/CuPDLPx.jl @@ -0,0 +1,7 @@ +module CuPDLPx + +# using Base.Enums +include("LibCuPDLPx.jl") +include("MOI_wrapper.jl") + +end # module CuPDLPx diff --git a/src/LibcuPDLPx.jl b/src/LibCuPDLPx.jl similarity index 99% rename from src/LibcuPDLPx.jl rename to src/LibCuPDLPx.jl index 1f1ee0e..b0c33ba 100644 --- a/src/LibcuPDLPx.jl +++ b/src/LibCuPDLPx.jl @@ -1,4 +1,4 @@ -module LibcuPDLPx +module LibCuPDLPx using cuPDLPx_jll export cuPDLPx_jll diff --git a/src/MOI_wrapper.jl b/src/MOI_wrapper.jl index c064b32..7b5bdb1 100644 --- a/src/MOI_wrapper.jl +++ b/src/MOI_wrapper.jl @@ -1,6 +1,6 @@ import MathOptInterface as MOI -const Lib = cuPDLPx.LibcuPDLPx +const Lib = CuPDLPx.LibCuPDLPx MOI.Utilities.@product_of_sets( _LPProductOfSets, @@ -26,7 +26,7 @@ const OptimizerCache = MOI.Utilities.GenericModel{ }, } -Base.show(io::IO, ::Type{OptimizerCache}) = print(io, "cuPDLPx.OptimizerCache") +Base.show(io::IO, ::Type{OptimizerCache}) = print(io, "CuPDLPx.OptimizerCache") const BOUND_SETS = Union{ MOI.GreaterThan{Float64}, @@ -137,7 +137,7 @@ end # Parameters # ==================== -MOI.get(::Optimizer, ::MOI.SolverName) = "cuPDLPx" +MOI.get(::Optimizer, ::MOI.SolverName) = "CuPDLPx" function MOI.supports(::Optimizer, param::MOI.RawOptimizerAttribute) s = Symbol(param.name) diff --git a/src/cuPDLPx.jl b/src/cuPDLPx.jl deleted file mode 100644 index 7154a79..0000000 --- a/src/cuPDLPx.jl +++ /dev/null @@ -1,7 +0,0 @@ -module cuPDLPx - -# using Base.Enums -include("LibcuPDLPx.jl") -include("MOI_wrapper.jl") - -end # module cuPDLPx diff --git a/test/MOI_wrapper.jl b/test/MOI_wrapper.jl index 5842362..411922c 100644 --- a/test/MOI_wrapper.jl +++ b/test/MOI_wrapper.jl @@ -2,10 +2,10 @@ module TestMOI using Test import MathOptInterface as MOI -import cuPDLPx +import CuPDLPx function test_runtests() - optimizer = cuPDLPx.Optimizer() + optimizer = CuPDLPx.Optimizer() MOI.set(optimizer, MOI.Silent(), true) # comment this to enable output model = MOI.Bridges.full_bridge_optimizer( MOI.Utilities.CachingOptimizer( diff --git a/test/runtests.jl b/test/runtests.jl index ec1747f..49d7935 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1,9 +1,9 @@ using Test -using cuPDLPx +using CuPDLPx -const Lib = cuPDLPx.LibcuPDLPx +const Lib = CuPDLPx.LibCuPDLPx -@testset "LibcuPDLPx Translation Tests" begin +@testset "LibCuPDLPx Translation Tests" begin # ========================================== # 1. Basic Enum Mapping Tests