Skip to content

Commit b280e04

Browse files
authored
[chore]: Upgrade to stubgen-pyx 0.2.22 (#2763)
1 parent fb57dbf commit b280e04

52 files changed

Lines changed: 206 additions & 152 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ repos:
8888
files: ^cuda_core/cuda/.*\.(pyx|pxd)$
8989
pass_filenames: false
9090
additional_dependencies:
91-
- stubgen-pyx==0.2.19
91+
- stubgen-pyx==0.2.22
9292
- Cython==3.2.9
9393

9494
# Link checking for authored documentation files

cuda_core/cuda/core/_context.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# This file was generated by stubgen-pyx v0.2.19 from cuda_core/cuda/core/_context.pyx
1+
# This file was generated by stubgen-pyx v0.2.22 from cuda_core/cuda/core/_context.pyx
22

33
from collections.abc import Sequence
44
from dataclasses import dataclass

cuda_core/cuda/core/_device.pyi

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
# This file was generated by stubgen-pyx v0.2.19 from cuda_core/cuda/core/_device.pyx
1+
# This file was generated by stubgen-pyx v0.2.22 from cuda_core/cuda/core/_device.pyx
2+
3+
import threading
24

35
import cuda.core.system
46
from cuda.core._context import Context, ContextOptions
@@ -13,6 +15,8 @@ from cuda.core.texture import (MipmappedArray, MipmappedArrayOptions,
1315
ResourceDescriptor, SurfaceObject,
1416
TextureObject, TextureObjectOptions)
1517

18+
_tls = threading.local()
19+
_lock = threading.Lock()
1620
__all__ = ['Device']
1721

1822
class DeviceProperties:

cuda_core/cuda/core/_device_resources.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# This file was generated by stubgen-pyx v0.2.19 from cuda_core/cuda/core/_device_resources.pyx
1+
# This file was generated by stubgen-pyx v0.2.22 from cuda_core/cuda/core/_device_resources.pyx
22

33
from collections.abc import Sequence as SequenceABC
44
from dataclasses import dataclass

cuda_core/cuda/core/_dlpack.pyi

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
1-
# This file was generated by stubgen-pyx v0.2.19 from cuda_core/cuda/core/_dlpack.pyx
1+
# This file was generated by stubgen-pyx v0.2.22 from cuda_core/cuda/core/_dlpack.pyx
22

33
from enum import IntEnum
4-
from typing import Any, Callable, TypeAlias, TypedDict
4+
from typing import Any, Callable, TypedDict
5+
6+
from typing_extensions import TypeAlias
57

68
_DLDeviceType: TypeAlias = int
79
DLDataTypeCode: TypeAlias = int
10+
DLPackManagedTensorAllocator: TypeAlias = Callable[[DLTensor, DLManagedTensorVersioned, Any, Callable[[Any, bytes, bytes], None]], int]
11+
DLPackManagedTensorFromPyObjectNoSync: TypeAlias = Callable[[Any, DLManagedTensorVersioned], int]
12+
DLPackManagedTensorToPyObjectNoSync: TypeAlias = Callable[[DLManagedTensorVersioned, Any], int]
13+
DLPackDLTensorFromPyObjectNoSync: TypeAlias = Callable[[Any, DLTensor], int]
14+
DLPackCurrentWorkStream: TypeAlias = Callable[[_DLDeviceType, int, Any], int]
815

916
class DLDeviceType(IntEnum):
1017
kDLCPU = 1
@@ -22,7 +29,7 @@ class DLDataType(TypedDict):
2229
lanes: int
2330

2431
class DLTensor(TypedDict):
25-
data: None
32+
data: Any
2633
device: DLDevice
2734
ndim: int
2835
dtype: DLDataType
@@ -32,17 +39,17 @@ class DLTensor(TypedDict):
3239

3340
class DLManagedTensor(TypedDict):
3441
dl_tensor: DLTensor
35-
manager_ctx: None
36-
deleter: Callable[..., Any]
42+
manager_ctx: Any
43+
deleter: Callable[[DLManagedTensor], None]
3744

3845
class DLPackVersion(TypedDict):
3946
major: int
4047
minor: int
4148

4249
class DLManagedTensorVersioned(TypedDict):
4350
version: DLPackVersion
44-
manager_ctx: None
45-
deleter: Callable[..., Any]
51+
manager_ctx: Any
52+
deleter: Callable[[DLManagedTensorVersioned], None]
4653
flags: int
4754
dl_tensor: DLTensor
4855

@@ -52,11 +59,11 @@ class DLPackExchangeAPIHeader(TypedDict):
5259

5360
class DLPackExchangeAPI(TypedDict):
5461
header: DLPackExchangeAPIHeader
55-
managed_tensor_allocator: ...
56-
managed_tensor_from_py_object_no_sync: ...
57-
managed_tensor_to_py_object_no_sync: ...
58-
dltensor_from_py_object_no_sync: ...
59-
current_work_stream: ...
62+
managed_tensor_allocator: DLPackManagedTensorAllocator
63+
managed_tensor_from_py_object_no_sync: DLPackManagedTensorFromPyObjectNoSync
64+
managed_tensor_to_py_object_no_sync: DLPackManagedTensorToPyObjectNoSync
65+
dltensor_from_py_object_no_sync: DLPackDLTensorFromPyObjectNoSync
66+
current_work_stream: DLPackCurrentWorkStream
6067

6168
def classify_dl_device(buf: object) -> tuple[int, int]:
6269
"""Classify a buffer into a DLPack (device_type, device_id) pair.

cuda_core/cuda/core/_event.pyi

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
# This file was generated by stubgen-pyx v0.2.19 from cuda_core/cuda/core/_event.pyx
1+
# This file was generated by stubgen-pyx v0.2.22 from cuda_core/cuda/core/_event.pyx
22

33
from dataclasses import dataclass
4-
from typing import Any
54

65
import cuda.bindings.driver
6+
from _typeshed import Incomplete
77
from cuda.core._context import Context
88
from cuda.core._device import Device
99

@@ -146,7 +146,7 @@ class IPCEventDescriptor:
146146
"""Serializable object describing an event that can be shared between processes."""
147147
def __init__(self, *arg, **kwargs) -> None: ...
148148
@staticmethod
149-
def _init(reserved: bytes, is_blocking_sync: Any) -> IPCEventDescriptor: ...
149+
def _init(reserved: bytes, is_blocking_sync: Incomplete) -> IPCEventDescriptor: ...
150150
def __eq__(self, other: object) -> bool: ...
151151
def __reduce__(self) -> tuple[object, ...]: ...
152152

cuda_core/cuda/core/_graphics.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# This file was generated by stubgen-pyx v0.2.19 from cuda_core/cuda/core/_graphics.pyx
1+
# This file was generated by stubgen-pyx v0.2.22 from cuda_core/cuda/core/_graphics.pyx
22

33
from typing import Sequence
44

cuda_core/cuda/core/_kernel_arg_handler.pyi

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
1-
# This file was generated by stubgen-pyx v0.2.19 from cuda_core/cuda/core/_kernel_arg_handler.pyx
1+
# This file was generated by stubgen-pyx v0.2.22 from cuda_core/cuda/core/_kernel_arg_handler.pyx
22

3-
from typing import Any, Sequence, TypeAlias, TypedDict
3+
from typing import Any, Sequence, TypedDict
44

5-
cpp_single_complex: TypeAlias = Any
6-
cpp_double_complex: TypeAlias = Any
5+
from _typeshed import Incomplete
6+
from typing_extensions import TypeAlias
7+
8+
cpp_single_complex: TypeAlias = Incomplete
9+
cpp_double_complex: TypeAlias = Incomplete
10+
voidptr: TypeAlias = Any
711

812
class __half_raw(TypedDict):
913
x: int

cuda_core/cuda/core/_launch_config.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# This file was generated by stubgen-pyx v0.2.19 from cuda_core/cuda/core/_launch_config.pyx
1+
# This file was generated by stubgen-pyx v0.2.22 from cuda_core/cuda/core/_launch_config.pyx
22

33
from typing import Any
44

cuda_core/cuda/core/_launcher.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# This file was generated by stubgen-pyx v0.2.19 from cuda_core/cuda/core/_launcher.pyx
1+
# This file was generated by stubgen-pyx v0.2.22 from cuda_core/cuda/core/_launcher.pyx
22

33
from cuda.core._launch_config import LaunchConfig
44
from cuda.core._module import Kernel

0 commit comments

Comments
 (0)