Skip to content

Commit 10df241

Browse files
authored
Replaced Ptr{Int8} with Ptr{Cchar} for ARM compatibility (#219)
1 parent b45d6f4 commit 10df241

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

.github/workflows/ci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ jobs:
2323
- os: windows-latest
2424
version: '1'
2525
arch: x64
26+
- os: ubuntu-24.04-arm
27+
version: '1'
28+
arch: aarch64
2629
steps:
2730
- uses: actions/checkout@v2
2831
- uses: julia-actions/setup-julia@v1

src/booster.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ end
198198
function save(b::Booster, ::Type{Vector{UInt8}}; format::AbstractString="json")
199199
cfg = JSON.json(Dict("format"=>format))
200200
olen = Ref{Lib.bst_ulong}()
201-
o = Ref{Ptr{Int8}}()
201+
o = Ref{Ptr{Cchar}}()
202202
xgbcall(XGBoosterSaveModelToBuffer, b.handle, cfg, olen, o)
203203
unsafe_wrap(Array, convert(Ptr{UInt8}, o[]), olen[])
204204
end
@@ -245,7 +245,7 @@ The output of this function can be loaded with [`deserialize`](@ref).
245245
"""
246246
function serialize(b::Booster)
247247
olen = Ref{Lib.bst_ulong}()
248-
o = Ref{Ptr{Int8}}() # don't know why it insists on Int8
248+
o = Ref{Ptr{Cchar}}() # don't know why it insists on Cchar
249249
xgbcall(XGBoosterSerializeToBuffer, b.handle, olen, o)
250250
unsafe_wrap(Array, convert(Ptr{UInt8}, o[]), olen[])
251251
end
@@ -336,7 +336,7 @@ predict(b::Booster, Xy::DMatrix; kw...) = copy(predict_nocopy(b, Xy; kw...))
336336
predict(b::Booster, Xy; kw...) = predict(b, DMatrix(Xy); kw...)
337337

338338
function evaliter(b::Booster, watch, n::Integer=1)
339-
o = Ref{Ptr{Int8}}()
339+
o = Ref{Ptr{Cchar}}()
340340
names = collect(Iterators.map(string, keys(watch)))
341341
watch = collect(Iterators.map(x -> x.handle, values(watch)))
342342
xgbcall(XGBoosterEvalOneIter, b.handle, n, watch, names, length(watch), o)

0 commit comments

Comments
 (0)