Skip to content

Commit a6f091e

Browse files
Restore private _handle attrs on Context and Kernel for downstream compat
Adds _handle properties that delegate to .handle on Context and Kernel, preserving backward compatibility for downstream projects (e.g., numba-cuda) that relied on the private attribute. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 2aba097 commit a6f091e

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

cuda_core/cuda/core/_context.pyx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ cdef class Context:
3939
return None
4040
return as_py(self._h_context)
4141

42+
@property
43+
def _handle(self):
44+
return self.handle
45+
4246
def __eq__(self, other):
4347
if not isinstance(other, Context):
4448
return NotImplemented

cuda_core/cuda/core/_module.pyx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -561,6 +561,10 @@ cdef class Kernel:
561561
"""
562562
return as_py(self._h_kernel)
563563

564+
@property
565+
def _handle(self):
566+
return self.handle
567+
564568
@staticmethod
565569
def from_handle(handle, mod: ObjectCode = None) -> Kernel:
566570
"""Creates a new :obj:`Kernel` object from a foreign kernel handle.

cuda_core/docs/nv-versions.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
"version": "latest",
44
"url": "https://nvidia.github.io/cuda-python/cuda-core/latest/"
55
},
6+
{
7+
"version": "0.6.0",
8+
"url": "https://nvidia.github.io/cuda-python/cuda-core/0.6.0/"
9+
},
610
{
711
"version": "0.5.1",
812
"url": "https://nvidia.github.io/cuda-python/cuda-core/0.5.1/"

0 commit comments

Comments
 (0)