Skip to content

Commit e9b64e1

Browse files
authored
Bump version from 0.5.5 to 0.5.6 and register Metal extension (#66)
1 parent cae24e3 commit e9b64e1

3 files changed

Lines changed: 6 additions & 1 deletion

File tree

‎Project.toml‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "StridedViews"
22
uuid = "4db3bf67-4bd7-4b4e-b153-31dc3fb37143"
33
authors = ["Lukas Devos <lukas.devos@ugent.be>", "Jutho Haegeman <jutho.haegeman@ugent.be>"]
4-
version = "0.5.5"
4+
version = "0.5.6"
55

66
[deps]
77
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
@@ -21,6 +21,7 @@ StridedViewsAMDGPUExt = "AMDGPU"
2121
StridedViewsCUDACoreExt = "CUDACore"
2222
StridedViewsFiniteDifferencesExt = "FiniteDifferences"
2323
StridedViewsJLArraysExt = "JLArrays"
24+
StridedViewsMetalExt = "Metal"
2425
StridedViewsPtrArraysExt = "PtrArrays"
2526
StridedViewsAdaptExt = "Adapt"
2627

‎ext/StridedViewsMetalExt.jl‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ using Metal: Adapt, MtlPtr
66

77
const MtlStridedView{T, N, A <: MtlArray{T}} = StridedView{T, N, A}
88

9+
StridedViews._normalizeparent(A::MtlArray, offset::Int) = reshape(A, length(A)), offset
10+
911
function Base.pointer(x::MtlStridedView{T}) where {T}
1012
return Base.unsafe_convert(MtlPtr{T}, pointer(x.parent, x.offset + 1))
1113
end

‎test/runtests.jl‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -386,8 +386,10 @@ if Metal.functional()
386386
@test isstrided(A)
387387
B = StridedView(A)
388388
@test B isa StridedView
389+
@test parent(B) isa MtlArray{T, 1}
389390
Metal.@allowscalar begin
390391
@test B == A
392+
@test parent(B) == reshape(A, :)
391393
end
392394
end
393395
end

0 commit comments

Comments
 (0)