Skip to content

Commit 743401b

Browse files
committed
Fix cuda_core cython-lint regressions after hook update.
Keep the pre-commit autoupdate green by cleaning up true dead imports and suppressing false positives from CUDA-major compile-time guards. Made-with: Cursor
1 parent 6ad8431 commit 743401b

File tree

6 files changed

+11
-17
lines changed

6 files changed

+11
-17
lines changed

cuda_core/cuda/core/_device.pyx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
from __future__ import annotations
66

77
cimport cpython
8-
from libc.stdint cimport uintptr_t
98

109
from cuda.bindings cimport cydriver
1110
from cuda.core._utils.cuda_utils cimport HANDLE_RETURN

cuda_core/cuda/core/_memory/_managed_memory_resource.pyx

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,11 @@ from __future__ import annotations
66

77
from cuda.bindings cimport cydriver
88

9-
from cuda.core._memory._memory_pool cimport _MemPool, MP_init_create_pool, MP_init_current_pool
10-
from cuda.core._utils.cuda_utils cimport (
11-
HANDLE_RETURN,
12-
check_or_create_options,
13-
)
14-
from cuda.core._utils.cuda_utils import CUDAError
9+
from cuda.core._memory._memory_pool cimport _MemPool
10+
from cuda.core._memory._memory_pool cimport MP_init_create_pool, MP_init_current_pool # no-cython-lint
11+
from cuda.core._utils.cuda_utils cimport HANDLE_RETURN
12+
from cuda.core._utils.cuda_utils cimport check_or_create_options # no-cython-lint
13+
from cuda.core._utils.cuda_utils import CUDAError # no-cython-lint
1514

1615
from dataclasses import dataclass
1716
import threading

cuda_core/cuda/core/_memory/_memory_pool.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ from cuda.core._resource_handles cimport (
1616
MemoryPoolHandle,
1717
DevicePtrHandle,
1818
create_mempool_handle,
19-
create_mempool_handle_ref,
2019
deviceptr_alloc_from_pool,
2120
as_cu,
2221
as_py,
2322
)
23+
from cuda.core._resource_handles cimport create_mempool_handle_ref # no-cython-lint
2424

2525
from cuda.core._utils.cuda_utils cimport (
2626
HANDLE_RETURN,

cuda_core/cuda/core/graph/_graph_def.pyx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,13 @@ from cuda.core._resource_handles cimport (
1919
as_intptr,
2020
as_py,
2121
create_graph_handle,
22-
create_graph_handle_ref,
2322
create_graph_node_handle,
2423
)
2524
from cuda.core._utils.cuda_utils cimport HANDLE_RETURN
2625

2726
from dataclasses import dataclass
2827

29-
from cuda.core._utils.cuda_utils import driver, handle_return
28+
from cuda.core._utils.cuda_utils import driver
3029

3130

3231
cdef class Condition:
@@ -347,7 +346,7 @@ cdef class GraphDef:
347346
with nogil:
348347
HANDLE_RETURN(cydriver.cuGraphGetNodes(as_cu(self._h_graph), nodes_vec.data(), &num_nodes))
349348
350-
return set(GraphNode._create(self._h_graph, nodes_vec[i]) for i in range(num_nodes))
349+
return {GraphNode._create(self._h_graph, nodes_vec[i]) for i in range(num_nodes)}
351350
352351
def edges(self) -> set:
353352
"""Return all edges in the graph as (from_node, to_node) pairs.
@@ -386,11 +385,11 @@ cdef class GraphDef:
386385
HANDLE_RETURN(cydriver.cuGraphGetEdges(
387386
as_cu(self._h_graph), from_nodes.data(), to_nodes.data(), &num_edges))
388387
389-
return set(
388+
return {
390389
(GraphNode._create(self._h_graph, from_nodes[i]),
391390
GraphNode._create(self._h_graph, to_nodes[i]))
392391
for i in range(num_edges)
393-
)
392+
}
394393
395394
@property
396395
def handle(self) -> driver.CUgraph:

cuda_core/cuda/core/graph/_graph_node.pyx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ from cuda.core._resource_handles cimport (
4444
as_cu,
4545
as_intptr,
4646
as_py,
47-
create_event_handle_ref,
4847
create_graph_handle_ref,
4948
create_graph_node_handle,
5049
graph_node_get_graph,
@@ -59,9 +58,8 @@ from cuda.core.graph._utils cimport (
5958

6059
import weakref
6160

62-
from cuda.core import Device
6361
from cuda.core.graph._adjacency_set_proxy import AdjacencySetProxy
64-
from cuda.core._utils.cuda_utils import driver, handle_return
62+
from cuda.core._utils.cuda_utils import driver
6563

6664
# See _cpp/REGISTRY_DESIGN.md (Level 2: Resource Handle -> Python Object)
6765
_node_registry = weakref.WeakValueDictionary()

cuda_core/cuda/core/graph/_subclasses.pyx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ from cuda.core._resource_handles cimport (
2626
create_event_handle_ref,
2727
create_graph_handle_ref,
2828
create_kernel_handle_ref,
29-
create_graph_node_handle,
3029
graph_node_get_graph,
3130
)
3231
from cuda.core._utils.cuda_utils cimport HANDLE_RETURN

0 commit comments

Comments
 (0)