Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
85d4a3a
Add StridedLayout
stiepan Nov 21, 2025
23b35fe
Support wrapping ptr in Buffer, create SMV from buffer and layout, dl…
stiepan Nov 17, 2025
2470617
Documentation, linting, minor fixes
stiepan Nov 18, 2025
cf7eff5
Add NotImplemented copy_from/copy_to
stiepan Nov 21, 2025
79010b8
Adjust flattening scalars to numpy/cupy behavior, fix shape validatio…
stiepan Nov 26, 2025
4ca3567
Add StridedLayout tests
stiepan Nov 26, 2025
acdd6f8
Use explicit int32_t instead of int in integer fused type
stiepan Nov 26, 2025
60a0d66
Disable (for now) exporting the SMV via dlpack
stiepan Nov 26, 2025
1fa43d4
Revert dlpack changes
stiepan Nov 26, 2025
67c6c5e
Support layouts up to 64 dims
stiepan Nov 27, 2025
a96bec5
Use cydriver to query memory attributes, fix managed memory handling,…
stiepan Nov 27, 2025
91387b0
Test owner and mr cannot be specified together
stiepan Nov 27, 2025
91c0af9
Test Buffer.close with owner
stiepan Nov 27, 2025
b74ef2c
Add envelope checks (rquires_size_in_bytes, offset_bounds)
stiepan Nov 27, 2025
2c0343f
Docs, annotation fixes, remove dlpack export mentions
stiepan Nov 27, 2025
598a2f1
Add SMV.from_buffer/view tests
stiepan Nov 27, 2025
bbb227b
Layout tests for SMV created from CAI
stiepan Nov 28, 2025
26dfe3b
Fix missing host unregister call in buffer test
stiepan Dec 1, 2025
3adae5c
Fix num attrib on re-try
stiepan Dec 1, 2025
7554164
Call int on the buffer.handle
stiepan Dec 1, 2025
68b7a79
Merge branch 'main' into introduce_strided_layout_memview
stiepan Dec 3, 2025
edace66
Don't enforce Buffer having an owner when creating SMV
stiepan Dec 3, 2025
9f86322
Use np._s instead of a custom helper in the tests
stiepan Dec 3, 2025
4335b2e
Take lanes into account when computing the itemsize
stiepan Dec 3, 2025
6568e27
Merge branch 'main' into introduce_strided_layout_memview
stiepan Dec 4, 2025
cbf1d17
Move layout validation out of get_data_ptr helper
stiepan Dec 4, 2025
4767fbb
Disambiguate all_axes mask for layout flattening, add range flattenin…
stiepan Dec 4, 2025
5765a22
Bring back the intptr_t in SMV
stiepan Dec 8, 2025
7ec8961
Merge branch 'main' into introduce_strided_layout_memview
stiepan Dec 8, 2025
db75aa0
Reorder methods, adjust SMV tests to from_dlpack/form_cai methods
stiepan Dec 8, 2025
639ee5f
Move the Device import to top-level imports
stiepan Dec 8, 2025
9fb5dfb
Merge branch 'main' into introduce_strided_layout_memview
stiepan Dec 8, 2025
3375b4d
Merge branch 'main' into introduce_strided_layout_memview
stiepan Dec 9, 2025
66fc6e8
Merge branch 'main' into introduce_strided_layout_memview
leofang Dec 10, 2025
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
Prev Previous commit
Next Next commit
Move the Device import to top-level imports
Signed-off-by: Kamil Tokarski <[email protected]>
  • Loading branch information
stiepan committed Dec 8, 2025
commit 639ee5f8ded8a71041128de63f86652d53f2b84f
2 changes: 1 addition & 1 deletion cuda_core/cuda/core/experimental/_memory/_buffer.pyx
Comment thread
leofang marked this conversation as resolved.
Resolved
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ from typing import TypeVar, Union

from cuda.core.experimental._dlpack import DLDeviceType, make_py_capsule
from cuda.core.experimental._utils.cuda_utils import driver
from cuda.core.experimental._device import Device

__all__ = ['Buffer', 'MemoryResource']

Expand Down Expand Up @@ -377,7 +378,6 @@ cdef inline int _query_memory_attrs(unsigned int& memory_type, int & is_managed,
if ret == cydriver.CUresult.CUDA_ERROR_NOT_INITIALIZED:
with cython.gil:
# Device class handles the cuInit call internally
from cuda.core.experimental import Device
Device()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can we call cuInit if that's what we're after, instead of calling Device?

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.

Device has a lock around the cuInit call, so I wanted to stick to that single section handling the call. I guess calling cuInit more than once wouldn't hurt us either. Or I could move that part from Device.__new__ into separate utility. I just though this is one-time thingy, trying to recover from an error, so being a bit lavish about the import and Device call is not that bad. What do you think?

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.

my 2c is let's keep this for now, I don't have clever thoughts here 😅

ret = cydriver.cuPointerGetAttributes(3, attrs, <void**>vals, ptr)
HANDLE_RETURN(ret)
Expand Down
Loading