From de8cc9fc87174f31a7093558125cd2c7f7b0d1fa Mon Sep 17 00:00:00 2001 From: Tim Besard Date: Tue, 31 Oct 2023 13:27:47 +0100 Subject: [PATCH] Fixes for Julia 1.11. --- lib/JLArrays/src/JLArrays.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/JLArrays/src/JLArrays.jl b/lib/JLArrays/src/JLArrays.jl index 8059d6fd..080383cb 100644 --- a/lib/JLArrays/src/JLArrays.jl +++ b/lib/JLArrays/src/JLArrays.jl @@ -97,7 +97,7 @@ Base.size(x::JLDeviceArray) = x.dims Base.sizeof(x::JLDeviceArray) = Base.elsize(x) * length(x) Base.unsafe_convert(::Type{Ptr{T}}, x::JLDeviceArray{T}) where {T} = - Base.unsafe_convert(Ptr{T}, x.data) + x.offset*Base.elsize(x) + convert(Ptr{T}, pointer(x.data)) + x.offset*Base.elsize(x) # conversion of untyped data to a typed Array function typed_data(x::JLDeviceArray{T}) where {T} @@ -269,7 +269,7 @@ Base.size(x::JLArray) = x.dims Base.sizeof(x::JLArray) = Base.elsize(x) * length(x) Base.unsafe_convert(::Type{Ptr{T}}, x::JLArray{T}) where {T} = - Base.unsafe_convert(Ptr{T}, x.data[]) + x.offset*Base.elsize(x) + convert(Ptr{T}, pointer(x.data[])) + x.offset*Base.elsize(x) ## interop with Julia arrays