Skip to content

Commit

Permalink
Update the Julia interface to not compile GALAHAD with -DMULTIPRECISION
Browse files Browse the repository at this point in the history
  • Loading branch information
amontoison committed Jan 6, 2025
1 parent e09f238 commit 8c79df1
Show file tree
Hide file tree
Showing 57 changed files with 8,765 additions and 9,699 deletions.
19 changes: 14 additions & 5 deletions GALAHAD.jl/gen/rewriter.jl
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,12 @@ function rewrite!(path::String, name::String, optimized::Bool)
routine_double_int32 = replace(routine_double_int32, "function $fname(" => "function $fname(::Type{Float64}, ::Type{Int32}, ")
routine_quadruple_int32 = replace(routine_quadruple_int32, "function $fname(" => "function $fname(::Type{Float128}, ::Type{Int32}, ")

routine_single_int32 = replace(routine_single_int32, "libgalahad_double.$fname(" => "libgalahad_single.$(fname)_s(")
routine_quadruple_int32 = replace(routine_quadruple_int32, "libgalahad_double.$fname(" => "libgalahad_quadruple.$(fname)_q(")
routine_single_int32 = replace(routine_single_int32, "libgalahad_double" => "libgalahad_single")
routine_quadruple_int32 = replace(routine_quadruple_int32, "libgalahad_double" => "libgalahad_quadruple")

# Uncomment if one day we compile GALAHAD with -DMULTIPRECISION
# routine_single_int32 = replace(routine_single_int32, "libgalahad_double.$fname(" => "libgalahad_single.$(fname)_s(")
# routine_quadruple_int32 = replace(routine_quadruple_int32, "libgalahad_double.$fname(" => "libgalahad_quadruple.$(fname)_q(")

routine_single_int32 = replace(routine_single_int32, "ipc_" => "Int32")
routine_double_int32 = replace(routine_double_int32, "ipc_" => "Int32")
Expand Down Expand Up @@ -152,9 +156,14 @@ function rewrite!(path::String, name::String, optimized::Bool)
routine_double_int64 = routine_double_int32
routine_quadruple_int64 = routine_quadruple_int32

routine_single_int64 = replace(routine_single_int64, "libgalahad_single.$(fname)_s(" => "libgalahad_single_64.$(fname)_s_64(")
routine_double_int64 = replace(routine_double_int64, "libgalahad_double.$(fname)(" => "libgalahad_double_64.$(fname)_64(")
routine_quadruple_int64 = replace(routine_quadruple_int64, "libgalahad_quadruple.$(fname)_q(" => "libgalahad_quadruple_64.$(fname)_q_64(")
routine_single_int64 = replace(routine_single_int64, "libgalahad_single." => "libgalahad_single_64")
routine_double_int64 = replace(routine_double_int64, "libgalahad_double" => "libgalahad_double_64")
routine_quadruple_int64 = replace(routine_quadruple_int64, "libgalahad_quadruple" => "libgalahad_quadruple_64")

# Uncomment if one day we compile GALAHAD with -DMULTIPRECISION
# routine_single_int64 = replace(routine_single_int64, "libgalahad_single.$(fname)_s(" => "libgalahad_single_64.$(fname)_s_64(")
# routine_double_int64 = replace(routine_double_int64, "libgalahad_double.$(fname)(" => "libgalahad_double_64.$(fname)_64(")
# routine_quadruple_int64 = replace(routine_quadruple_int64, "libgalahad_quadruple.$(fname)_q(" => "libgalahad_quadruple_64.$(fname)_q_64(")

routine_single_int64 = replace(routine_single_int64, "Int32" => "Int64")
routine_double_int64 = replace(routine_double_int64, "Int32" => "Int64")
Expand Down
513 changes: 243 additions & 270 deletions GALAHAD.jl/src/wrappers/arc.jl

Large diffs are not rendered by default.

573 changes: 271 additions & 302 deletions GALAHAD.jl/src/wrappers/bgo.jl

Large diffs are not rendered by default.

544 changes: 255 additions & 289 deletions GALAHAD.jl/src/wrappers/blls.jl

Large diffs are not rendered by default.

335 changes: 160 additions & 175 deletions GALAHAD.jl/src/wrappers/bllsb.jl

Large diffs are not rendered by default.

699 changes: 326 additions & 373 deletions GALAHAD.jl/src/wrappers/bnls.jl

Large diffs are not rendered by default.

451 changes: 213 additions & 238 deletions GALAHAD.jl/src/wrappers/bqp.jl

Large diffs are not rendered by default.

350 changes: 164 additions & 186 deletions GALAHAD.jl/src/wrappers/bqpb.jl

Large diffs are not rendered by default.

94 changes: 46 additions & 48 deletions GALAHAD.jl/src/wrappers/bsc.jl
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@ end
export bsc_initialize

function bsc_initialize(::Type{Float32}, ::Type{Int32}, data, control, status)
@ccall libgalahad_single.bsc_initialize_s(data::Ptr{Ptr{Cvoid}},
control::Ptr{bsc_control_type{Int32}},
status::Ptr{Int32})::Cvoid
@ccall libgalahad_single.bsc_initialize(data::Ptr{Ptr{Cvoid}},
control::Ptr{bsc_control_type{Int32}},
status::Ptr{Int32})::Cvoid
end

function bsc_initialize(::Type{Float32}, ::Type{Int64}, data, control, status)
@ccall libgalahad_single_64.bsc_initialize_s_64(data::Ptr{Ptr{Cvoid}},
control::Ptr{bsc_control_type{Int64}},
status::Ptr{Int64})::Cvoid
@ccall libgalahad_single_64bsc_initialize(data::Ptr{Ptr{Cvoid}},
control::Ptr{bsc_control_type{Int64}},
status::Ptr{Int64})::Cvoid
end

function bsc_initialize(::Type{Float64}, ::Type{Int32}, data, control, status)
Expand All @@ -47,36 +47,35 @@ function bsc_initialize(::Type{Float64}, ::Type{Int32}, data, control, status)
end

function bsc_initialize(::Type{Float64}, ::Type{Int64}, data, control, status)
@ccall libgalahad_double_64.bsc_initialize_64(data::Ptr{Ptr{Cvoid}},
control::Ptr{bsc_control_type{Int64}},
status::Ptr{Int64})::Cvoid
@ccall libgalahad_double_64.bsc_initialize(data::Ptr{Ptr{Cvoid}},
control::Ptr{bsc_control_type{Int64}},
status::Ptr{Int64})::Cvoid
end

function bsc_initialize(::Type{Float128}, ::Type{Int32}, data, control, status)
@ccall libgalahad_quadruple.bsc_initialize_q(data::Ptr{Ptr{Cvoid}},
control::Ptr{bsc_control_type{Int32}},
status::Ptr{Int32})::Cvoid
@ccall libgalahad_quadruple.bsc_initialize(data::Ptr{Ptr{Cvoid}},
control::Ptr{bsc_control_type{Int32}},
status::Ptr{Int32})::Cvoid
end

function bsc_initialize(::Type{Float128}, ::Type{Int64}, data, control, status)
@ccall libgalahad_quadruple_64.bsc_initialize_q_64(data::Ptr{Ptr{Cvoid}},
control::Ptr{bsc_control_type{Int64}},
status::Ptr{Int64})::Cvoid
@ccall libgalahad_quadruple_64.bsc_initialize(data::Ptr{Ptr{Cvoid}},
control::Ptr{bsc_control_type{Int64}},
status::Ptr{Int64})::Cvoid
end

export bsc_information

function bsc_information(::Type{Float32}, ::Type{Int32}, data, inform, status)
@ccall libgalahad_single.bsc_information_s(data::Ptr{Ptr{Cvoid}},
inform::Ptr{bsc_inform_type{Float32,Int32}},
status::Ptr{Int32})::Cvoid
@ccall libgalahad_single.bsc_information(data::Ptr{Ptr{Cvoid}},
inform::Ptr{bsc_inform_type{Float32,Int32}},
status::Ptr{Int32})::Cvoid
end

function bsc_information(::Type{Float32}, ::Type{Int64}, data, inform, status)
@ccall libgalahad_single_64.bsc_information_s_64(data::Ptr{Ptr{Cvoid}},
inform::Ptr{bsc_inform_type{Float32,
Int64}},
status::Ptr{Int64})::Cvoid
@ccall libgalahad_single_64bsc_information(data::Ptr{Ptr{Cvoid}},
inform::Ptr{bsc_inform_type{Float32,Int64}},
status::Ptr{Int64})::Cvoid
end

function bsc_information(::Type{Float64}, ::Type{Int32}, data, inform, status)
Expand All @@ -86,36 +85,36 @@ function bsc_information(::Type{Float64}, ::Type{Int32}, data, inform, status)
end

function bsc_information(::Type{Float64}, ::Type{Int64}, data, inform, status)
@ccall libgalahad_double_64.bsc_information_64(data::Ptr{Ptr{Cvoid}},
inform::Ptr{bsc_inform_type{Float64,Int64}},
status::Ptr{Int64})::Cvoid
@ccall libgalahad_double_64.bsc_information(data::Ptr{Ptr{Cvoid}},
inform::Ptr{bsc_inform_type{Float64,Int64}},
status::Ptr{Int64})::Cvoid
end

function bsc_information(::Type{Float128}, ::Type{Int32}, data, inform, status)
@ccall libgalahad_quadruple.bsc_information_q(data::Ptr{Ptr{Cvoid}},
inform::Ptr{bsc_inform_type{Float128,Int32}},
status::Ptr{Int32})::Cvoid
@ccall libgalahad_quadruple.bsc_information(data::Ptr{Ptr{Cvoid}},
inform::Ptr{bsc_inform_type{Float128,Int32}},
status::Ptr{Int32})::Cvoid
end

function bsc_information(::Type{Float128}, ::Type{Int64}, data, inform, status)
@ccall libgalahad_quadruple_64.bsc_information_q_64(data::Ptr{Ptr{Cvoid}},
inform::Ptr{bsc_inform_type{Float128,
Int64}},
status::Ptr{Int64})::Cvoid
@ccall libgalahad_quadruple_64.bsc_information(data::Ptr{Ptr{Cvoid}},
inform::Ptr{bsc_inform_type{Float128,
Int64}},
status::Ptr{Int64})::Cvoid
end

export bsc_terminate

function bsc_terminate(::Type{Float32}, ::Type{Int32}, data, control, inform)
@ccall libgalahad_single.bsc_terminate_s(data::Ptr{Ptr{Cvoid}},
control::Ptr{bsc_control_type{Int32}},
inform::Ptr{bsc_inform_type{Float32,Int32}})::Cvoid
@ccall libgalahad_single.bsc_terminate(data::Ptr{Ptr{Cvoid}},
control::Ptr{bsc_control_type{Int32}},
inform::Ptr{bsc_inform_type{Float32,Int32}})::Cvoid
end

function bsc_terminate(::Type{Float32}, ::Type{Int64}, data, control, inform)
@ccall libgalahad_single_64.bsc_terminate_s_64(data::Ptr{Ptr{Cvoid}},
control::Ptr{bsc_control_type{Int64}},
inform::Ptr{bsc_inform_type{Float32,Int64}})::Cvoid
@ccall libgalahad_single_64bsc_terminate(data::Ptr{Ptr{Cvoid}},
control::Ptr{bsc_control_type{Int64}},
inform::Ptr{bsc_inform_type{Float32,Int64}})::Cvoid
end

function bsc_terminate(::Type{Float64}, ::Type{Int32}, data, control, inform)
Expand All @@ -125,20 +124,19 @@ function bsc_terminate(::Type{Float64}, ::Type{Int32}, data, control, inform)
end

function bsc_terminate(::Type{Float64}, ::Type{Int64}, data, control, inform)
@ccall libgalahad_double_64.bsc_terminate_64(data::Ptr{Ptr{Cvoid}},
control::Ptr{bsc_control_type{Int64}},
inform::Ptr{bsc_inform_type{Float64,Int64}})::Cvoid
@ccall libgalahad_double_64.bsc_terminate(data::Ptr{Ptr{Cvoid}},
control::Ptr{bsc_control_type{Int64}},
inform::Ptr{bsc_inform_type{Float64,Int64}})::Cvoid
end

function bsc_terminate(::Type{Float128}, ::Type{Int32}, data, control, inform)
@ccall libgalahad_quadruple.bsc_terminate_q(data::Ptr{Ptr{Cvoid}},
control::Ptr{bsc_control_type{Int32}},
inform::Ptr{bsc_inform_type{Float128,Int32}})::Cvoid
@ccall libgalahad_quadruple.bsc_terminate(data::Ptr{Ptr{Cvoid}},
control::Ptr{bsc_control_type{Int32}},
inform::Ptr{bsc_inform_type{Float128,Int32}})::Cvoid
end

function bsc_terminate(::Type{Float128}, ::Type{Int64}, data, control, inform)
@ccall libgalahad_quadruple_64.bsc_terminate_q_64(data::Ptr{Ptr{Cvoid}},
control::Ptr{bsc_control_type{Int64}},
inform::Ptr{bsc_inform_type{Float128,
Int64}})::Cvoid
@ccall libgalahad_quadruple_64.bsc_terminate(data::Ptr{Ptr{Cvoid}},
control::Ptr{bsc_control_type{Int64}},
inform::Ptr{bsc_inform_type{Float128,Int64}})::Cvoid
end
Loading

0 comments on commit 8c79df1

Please sign in to comment.