Skip to content

Commit

Permalink
replace unsafe_convert with pointer
Browse files Browse the repository at this point in the history
  • Loading branch information
mcabbott committed Feb 10, 2024
1 parent 935bf3d commit 58ad3d8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/batched/batchedadjtrans.jl
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ function Base.stride(A::Union{BatchedTranspose, BatchedAdjoint{<:Real}}, d::Inte
Base.stride(A.parent, d)
end

Base.pointer(A::BatchedAdjOrTrans) = pointer(parent(A))
Base.unsafe_convert(::Type{Ptr{T}}, A::BatchedAdjOrTrans{T}) where {T} =
Base.unsafe_convert(Ptr{T}, parent(A))

Expand Down
6 changes: 3 additions & 3 deletions src/gemm.jl
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@ for (gemm, elt) in gemm_datatype_mappings
LinearAlgebra.BLAS.chkstride1(B)
LinearAlgebra.BLAS.chkstride1(C)

ptrA = Base.unsafe_convert(Ptr{$elt}, A)
ptrB = Base.unsafe_convert(Ptr{$elt}, B)
ptrC = Base.unsafe_convert(Ptr{$elt}, C)
ptrA = pointer(A)
ptrB = pointer(B)
ptrC = pointer(C)

strA = size(A, 3) == 1 ? 0 : Base.stride(A, 3)
strB = size(B, 3) == 1 ? 0 : Base.stride(B, 3)
Expand Down

0 comments on commit 58ad3d8

Please sign in to comment.