Skip to content

Commit 3e3f93a

Browse files
committed
tripped again: Cython enforces type annotations at compile time
1 parent 9ed0173 commit 3e3f93a

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

cuda_core/cuda/core/experimental/_memory.pyx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ class MemoryResource(abc.ABC):
261261
...
262262

263263
@abc.abstractmethod
264-
def allocate(self, size: int, stream: Stream = None) -> Buffer:
264+
def allocate(self, size_t size, stream: Stream = None) -> Buffer:
265265
"""Allocate a buffer of the requested size.
266266

267267
Parameters
@@ -282,7 +282,7 @@ class MemoryResource(abc.ABC):
282282
...
283283

284284
@abc.abstractmethod
285-
def deallocate(self, ptr: DevicePointerT, size: int, stream: Stream = None):
285+
def deallocate(self, ptr: DevicePointerT, size_t size, stream: Stream = None):
286286
"""Deallocate a buffer previously allocated by this resource.
287287
288288
Parameters
@@ -358,7 +358,7 @@ class DeviceMemoryResource(MemoryResource):
358358
)
359359
raise_if_driver_error(err)
360360

361-
def allocate(self, size: int, stream: Stream = None) -> Buffer:
361+
def allocate(self, size_t size, stream: Stream = None) -> Buffer:
362362
"""Allocate a buffer of the requested size.
363363

364364
Parameters
@@ -381,7 +381,7 @@ class DeviceMemoryResource(MemoryResource):
381381
raise_if_driver_error(err)
382382
return Buffer._init(ptr, size, self)
383383

384-
def deallocate(self, ptr: DevicePointerT, size: int, stream: Stream = None):
384+
def deallocate(self, ptr: DevicePointerT, size_t size, stream: Stream = None):
385385
"""Deallocate a buffer previously allocated by this resource.
386386
387387
Parameters
@@ -424,7 +424,7 @@ class LegacyPinnedMemoryResource(MemoryResource):
424424
# TODO: support flags from cuMemHostAlloc?
425425
self._handle = None
426426

427-
def allocate(self, size: int, stream: Stream = None) -> Buffer:
427+
def allocate(self, size_t size, stream: Stream = None) -> Buffer:
428428
"""Allocate a buffer of the requested size.
429429

430430
Parameters
@@ -443,7 +443,7 @@ class LegacyPinnedMemoryResource(MemoryResource):
443443
raise_if_driver_error(err)
444444
return Buffer._init(ptr, size, self)
445445

446-
def deallocate(self, ptr: DevicePointerT, size: int, stream: Stream = None):
446+
def deallocate(self, ptr: DevicePointerT, size_t size, stream: Stream = None):
447447
"""Deallocate a buffer previously allocated by this resource.
448448
449449
Parameters

0 commit comments

Comments
 (0)