Skip to content

Commit b303f85

Browse files
committed
fix(core): use CUmemAllocationType for VMM allocation enums
Read CU_MEM_ALLOCATION_TYPE_* from CUmemAllocationType instead of CUmemAccess_flags so cuda.core imports correctly in test/docs CI jobs. Made-with: Cursor
1 parent 1e931db commit b303f85

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

cuda_core/cuda/core/_memory/_virtual_memory_resource.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,12 @@ class VirtualMemoryResourceOptions:
9696
"host_numa": _l.CU_MEM_LOCATION_TYPE_HOST_NUMA,
9797
"host_numa_current": _l.CU_MEM_LOCATION_TYPE_HOST_NUMA_CURRENT,
9898
}
99+
_t = driver.CUmemAllocationType
99100
# CUDA 13+ exposes MANAGED in CUmemAllocationType; older 12.x does not
100-
_allocation_type = {"pinned": _a.CU_MEM_ALLOCATION_TYPE_PINNED} # noqa: RUF012
101+
_allocation_type = {"pinned": _t.CU_MEM_ALLOCATION_TYPE_PINNED} # noqa: RUF012
101102
ver_major, ver_minor = get_binding_version()
102103
if ver_major >= 13:
103-
_allocation_type["managed"] = _a.CU_MEM_ALLOCATION_TYPE_MANAGED
104+
_allocation_type["managed"] = _t.CU_MEM_ALLOCATION_TYPE_MANAGED
104105

105106
@staticmethod
106107
def _access_to_flags(spec: str):

0 commit comments

Comments
 (0)