Skip to content

Slow but working copyto#52

Open
kshyatt wants to merge 3 commits intomainfrom
ksh/copyto
Open

Slow but working copyto#52
kshyatt wants to merge 3 commits intomainfrom
ksh/copyto

Conversation

@kshyatt
Copy link
Member

@kshyatt kshyatt commented Mar 18, 2026

Needs tests but handles copyto! without scalar indexing. Definitely could be improved with some Cartesian indexing. Needed for the more complex index-manipulated TensorKit operations.

@github-actions
Copy link

github-actions bot commented Mar 18, 2026

Your PR no longer requires formatting changes. Thank you for your contribution!

Comment on lines +45 to +46
function Base.copyto!(dest::StridedView{TD, ND, TAD, FD}, dstart::Integer,
src::StridedView{TS, NS, TAS, FS}, sstart::Integer, n::Integer) where {TD, TS, ND, NS, TAD <: AbstractGPUArray{TD}, TAS <: AbstractGPUArray{TS}, FD, FS}
Copy link
Member

Choose a reason for hiding this comment

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

Does it make sense to do this with offsets and linear indexing? Is this 5-arg version used anywhere? It doesn't feel very natural to have a linear offset/start in a strided but not necessarily contiguous array.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, it's directly used in multiple copyto! calls very deep in TensorKit that are quite brittle and easy to get wrong

Copy link
Member Author

Choose a reason for hiding this comment

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

This one is invoked directly by the one-line function after this one, it's copying something in GPUArrays

@codecov
Copy link

codecov bot commented Mar 18, 2026

Codecov Report

❌ Patch coverage is 0% with 20 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
ext/StridedGPUArraysExt.jl 0.00% 20 Missing ⚠️
Files with missing lines Coverage Δ
ext/StridedGPUArraysExt.jl 35.13% <0.00%> (-37.09%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants