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
3 changes: 3 additions & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,15 @@ PrecompileTools = "aea7be01-6a6a-4083-8856-8a6e6704d82a"
AMDGPU = "21141c5a-9bdb-4563-92ae-f87d6854732e"
Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"
CUDACore = "bd0ed864-bdfe-4181-a5ed-ce625a5fdea2"
FiniteDifferences = "26cc04aa-876d-5657-8c51-4c34ba976000"
JLArrays = "27aeb0d3-9eb9-45fb-866b-73c2ecf80fcb"
Metal = "dde4c033-4e86-420c-a63e-0dd931031962"
PtrArrays = "43287f4e-b6f4-7ad1-bb20-aadabca52c3d"

[extensions]
StridedViewsAMDGPUExt = "AMDGPU"
StridedViewsCUDACoreExt = "CUDACore"
StridedViewsFiniteDifferencesExt = "FiniteDifferences"
StridedViewsJLArraysExt = "JLArrays"
StridedViewsPtrArraysExt = "PtrArrays"
StridedViewsAdaptExt = "Adapt"
Expand All @@ -26,6 +28,7 @@ StridedViewsAdaptExt = "Adapt"
AMDGPU = "2"
Adapt = "4"
CUDACore = "6"
FiniteDifferences = "0.12"
JLArrays = "0.3.1"
LinearAlgebra = "1"
Metal = "1"
Expand Down
12 changes: 12 additions & 0 deletions ext/StridedViewsFiniteDifferencesExt.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
module StridedViewsFiniteDifferencesExt

using StridedViews: StridedView
using FiniteDifferences

function FiniteDifferences.to_vec(x::StridedView)
x_vec, from_vec = FiniteDifferences.to_vec(Array(x))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

do you know if this is an extra copy we might be able to avoid?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I tried it (removing the Array) back at TensorKit and the tests all started blowing up again, unfortunately

StridedView_from_vec(x_vec) = StridedView(from_vec(x_vec))
return x_vec, StridedView_from_vec
end
Comment thread
lkdvos marked this conversation as resolved.

end
Loading