Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "StridedViews"
uuid = "4db3bf67-4bd7-4b4e-b153-31dc3fb37143"
authors = ["Lukas Devos <lukas.devos@ugent.be>", "Jutho Haegeman <jutho.haegeman@ugent.be>"]
version = "0.4.4"
version = "0.4.5"

[deps]
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Expand Down
2 changes: 1 addition & 1 deletion ext/StridedViewsAMDGPUExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module StridedViewsAMDGPUExt

using StridedViews
using AMDGPU
using AMDGPU: Adapt, ROCPtr
using AMDGPU: Adapt

const ROCStridedView{T, N, A <: ROCArray{T}} = StridedView{T, N, A}

Expand Down
12 changes: 8 additions & 4 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -304,23 +304,27 @@ using CUDA, AMDGPU
if CUDA.functional()
@testset "CuArrays with StridedView" begin
@testset for T in (Float64, ComplexF64)
A = CUDA.randn!(T, 10, 10, 10, 10)
A = CUDA.randn(T, 10, 10, 10, 10)
@test isstrided(A)
B = StridedView(A)
@test B isa StridedView
@test B == A
CUDA.@allowscalar begin
@test B == A
end
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was wondering about how this worked, i.e. what method it was dispatched to. It's probably some AbstractArray fallback in Base?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think so, yes. Another option is to copy these back to the CPU, but I worried we wouldn't be able to distentangle a bug in the copying back vs something with the StridedView itself...

end
end
end

if AMDGPU.functional()
@testset "ROCArrays with StridedView" begin
@testset for T in (Float64, ComplexF64)
A = AMDGPU.randn!(T, 10, 10, 10, 10)
A = ROCArray(randn(T, 10, 10, 10, 10))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't know if this also exists?

Suggested change
A = ROCArray(randn(T, 10, 10, 10, 10))
A = ROCArray.randn(T, 10, 10, 10, 10)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't work for complex element types unfortunately

@test isstrided(A)
B = StridedView(A)
@test B isa StridedView
@test B == A
AMDGPU.@allowscalar begin
@test B == A
end
end
end
end
Loading