Skip to content

Commit 48de1b3

Browse files
committed
Cython mis-compiles Optional types
1 parent e96bb4a commit 48de1b3

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

cuda_core/cuda/core/experimental/_device.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1222,7 +1222,7 @@ def create_context(self, options: ContextOptions = None) -> Context:
12221222
"""
12231223
raise NotImplementedError("WIP: https://github.com/NVIDIA/cuda-python/issues/189")
12241224

1225-
def create_stream(self, obj: Optional[IsStreamT] = None, options: StreamOptions = None) -> Stream:
1225+
def create_stream(self, obj: Optional[IsStreamT] = None, options: Optional[StreamOptions] = None) -> Stream:
12261226
"""Create a Stream object.
12271227
12281228
New stream objects can be created in two different ways:

cuda_core/cuda/core/experimental/_event.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ cdef class Event:
8888
raise RuntimeError("Event objects cannot be instantiated directly. Please use Stream APIs (record).")
8989

9090
@classmethod
91-
def _init(cls, device_id: int, ctx_handle: Context, options: Optional[EventOptions] = None):
91+
def _init(cls, device_id: int, ctx_handle: Context, options=None):
9292
cdef Event self = Event.__new__(Event)
9393
cdef EventOptions opts = check_or_create_options(EventOptions, options, "Event options")
9494
flags = 0x0

cuda_core/cuda/core/experimental/_stream.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ cdef class Stream:
145145
return self
146146

147147
@classmethod
148-
def _init(cls, obj: Optional[IsStreamT] = None, *, options: Optional[StreamOptions] = None, device_id: int = None):
148+
def _init(cls, obj: Optional[IsStreamT] = None, options=None, device_id: int = None):
149149
cdef Stream self = Stream.__new__(Stream)
150150
self._handle = None
151151
self._owner = None

0 commit comments

Comments
 (0)