Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@seberg
Copy link
Member

@seberg seberg commented Oct 10, 2025

This allows cupy_arr[...] = cupy_like where cupy-like supports the CUDA array interface or __cupy_get_ndarray__.

Since there were a few (not many!) places that have a similar logic I, opionatedly, consolidated them into a cdef inline function. Similarly moved the test helper classes to not have to repeat them.

The biggest part of the diff is just moving those helpers!

I am very sure that cdef inline must be in the .pyd file to actually be inlined (which means many are currenlty not).

Closes gh-9089

@seberg seberg requested a review from a team as a code owner October 10, 2025 14:22
This allows `cupy_arr[...] = cupy_like` where cupy-like supports the
CUDA array interface or `__cupy_get_ndarray__`.

Since there were a few (not many!) places that have a similar logic
I, opionatedly, consolidated them into a `cdef inline` function.
Similarly moved the test helper classes to not have to repeat them.

The biggest part of the diff is just moving those helpers!

I am very sure that `cdef inline` must be in the `.pyd` file to
actually be inlined (which means many are currenlty not).
@seberg seberg force-pushed the setitem-cupy-like branch from 7c126f0 to c259a88 Compare October 10, 2025 14:34
@seberg
Copy link
Member Author

seberg commented Oct 10, 2025

/test mini

@asi1024
Copy link
Member

asi1024 commented Oct 15, 2025

LGTM!

@asi1024 asi1024 enabled auto-merge October 15, 2025 10:44
@asi1024 asi1024 added cat:enhancement Improvements to existing features prio:high labels Oct 15, 2025
@asi1024 asi1024 merged commit eea5222 into cupy:main Oct 15, 2025
51 checks passed
@seberg seberg deleted the setitem-cupy-like branch October 15, 2025 13:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cat:enhancement Improvements to existing features prio:high

Projects

None yet

3 participants