Commit c63874d
committed
fix(cuda.core): define _read_preferred_location_v2 stub on cu12 builds
Commit 7344d89 lifted the `_read_preferred_location_v2` import in
`_managed_buffer.py` from deferred (inside the property getter) to
module top, per leofang's "no deferred imports" guidance. But that
function was only defined inside the `IF CUDA_CORE_BUILD_MAJOR >= 13`
block in `_managed_memory_ops.pyx`, so on a cu12 build the symbol
doesn't exist and `import cuda.core` fails with
ImportError: cannot import name '_read_preferred_location_v2' from
'cuda.core._memory._managed_memory_ops'
Add an ELSE branch defining a stub that raises `NotImplementedError`.
`ManagedBuffer.preferred_location` already gates on both
binding_version() and driver_version() >= (13, 0, 0) before calling,
so the stub is unreachable at runtime — it exists only to satisfy
the unconditional module-level import on cu12.
Fixes CI failure on all 12.9.1 test jobs.1 parent 47d2358 commit c63874d
1 file changed
Lines changed: 10 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
367 | 367 | | |
368 | 368 | | |
369 | 369 | | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
370 | 380 | | |
371 | 381 | | |
372 | 382 | | |
| |||
0 commit comments