From 5e1f879b5ea1e786fcacb77a607ac7c8ad121dd4 Mon Sep 17 00:00:00 2001 From: Nikita Grigorian Date: Sat, 11 Apr 2026 16:46:58 -0700 Subject: [PATCH 1/3] remove usage of deprecated, legacy property syntax --- dpctl/_sycl_queue.pyx | 12 +++---- dpctl/memory/_memory.pyx | 78 ++++++++++++++++++++-------------------- 2 files changed, 45 insertions(+), 45 deletions(-) diff --git a/dpctl/_sycl_queue.pyx b/dpctl/_sycl_queue.pyx index 48c882b860..06f1017f73 100644 --- a/dpctl/_sycl_queue.pyx +++ b/dpctl/_sycl_queue.pyx @@ -1747,12 +1747,12 @@ cdef class WorkGroupMemory: def is_available(): return DPCTLWorkGroupMemory_Available() - property _ref: + @property + def _ref(self): """Returns the address of the C API ``DPCTLWorkGroupMemoryRef`` pointer as a ``size_t``. """ - def __get__(self): - return self._mem_ref + return self._mem_ref cdef class _RawKernelArg: @@ -1842,9 +1842,9 @@ cdef class RawKernelArg: def is_available(): return DPCTLRawKernelArg_Available() - property _ref: + @property + def _ref(self): """Returns the address of the C API ``DPCTLRawKernelArgRef`` pointer as a ``size_t``. """ - def __get__(self): - return self._arg_ref + return self._arg_ref diff --git a/dpctl/memory/_memory.pyx b/dpctl/memory/_memory.pyx index 0cc6394741..f290fe62b7 100644 --- a/dpctl/memory/_memory.pyx +++ b/dpctl/memory/_memory.pyx @@ -290,63 +290,63 @@ cdef class _Memory: buffer.strides = &buffer.itemsize buffer.suboffsets = NULL # for pointer arrays only - property nbytes: + @property + def nbytes(self): """Extent of this USM buffer in bytes.""" - def __get__(self): - return self.nbytes + return self.nbytes - property size: + @property + def size(self): """Extent of this USM buffer in bytes.""" - def __get__(self): - return self.nbytes + return self.nbytes - property _pointer: + @property + def _pointer(self): """ USM pointer at the start of this buffer represented as Python integer. """ - def __get__(self): - return (self._memory_ptr) + return (self._memory_ptr) - property _context: + @property + def _context(self): """:class:`dpctl.SyclContext` the USM pointer is bound to. """ - def __get__(self): - return self.queue.get_sycl_context() + return self.queue.get_sycl_context() - property _queue: + @property + def _queue(self): """ :class:`dpctl.SyclQueue` with :class:`dpctl.SyclContext` the USM allocation is bound to and :class:`dpctl.SyclDevice` it was allocated on. """ - def __get__(self): - return self.queue + return self.queue - property reference_obj: + @property + def reference_obj(self): """ Reference to the Python object owning this USM buffer. """ - def __get__(self): - return self.refobj + return self.refobj - property sycl_context: + @property + def sycl_context(self): """:class:`dpctl.SyclContext` the USM pointer is bound to.""" - def __get__(self): - return self.queue.get_sycl_context() + return self.queue.get_sycl_context() - property sycl_device: + @property + def sycl_device(self): """:class:`dpctl.SyclDevice` the USM pointer is bound to.""" - def __get__(self): - return self.queue.get_sycl_device() + return self.queue.get_sycl_device() - property sycl_queue: + @property + def sycl_queue(self): """ :class:`dpctl.SyclQueue` with :class:`dpctl.SyclContext` the USM allocation is bound to and :class:`dpctl.SyclDevice` it was allocated on. """ - def __get__(self): - return self.queue + return self.queue def __repr__(self): return ( @@ -370,7 +370,8 @@ cdef class _Memory: def __reduce__(self): return _to_memory, (self.copy_to_host(), self.get_usm_type()) - property __sycl_usm_array_interface__: + @property + def __sycl_usm_array_interface__(self): """ Dictionary encoding information about USM allocation. @@ -396,17 +397,16 @@ cdef class _Memory: Queue associated with this class instance. """ - def __get__(self): - cdef dict iface = { - "data": ((self._memory_ptr), - True), # bool(self.writable)), - "shape": (self.nbytes,), - "strides": None, - "typestr": "|u1", - "version": 1, - "syclobj": self.queue - } - return iface + cdef dict iface = { + "data": ((self._memory_ptr), + True), # bool(self.writable)), + "shape": (self.nbytes,), + "strides": None, + "typestr": "|u1", + "version": 1, + "syclobj": self.queue, + } + return iface def get_usm_type(self, syclobj=None): """ From cce3e8aa435c9a1923d57f7986ae3d29d57f94f1 Mon Sep 17 00:00:00 2001 From: Nikita Grigorian Date: Sat, 11 Apr 2026 17:01:39 -0700 Subject: [PATCH 2/3] add gh-2277 to changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f07cde01a9..9a53df8d1e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 * Enabled multiversion documentation for `dpctl` using a custom drop-down for version selection and a `--multiversion` option for documentation build helper script [gh-2276](https://github.com/IntelPython/dpctl/pull/2276) * Updated examples to remove use of `dpctl.tensor`, opting to simplify the examples and rely on `dpctl.memory` objects which wrap USM allocations [gh-2245](https://github.com/IntelPython/dpctl/pull/2245) +* Removed deprecated property syntax from Cython files [gh-2277](https://github.com/IntelPython/dpctl/pull/2277) ## [0.21.1] - Nov. 29, 2025 From 64112fe4a5baf7f7269573dd881af7467fdb46d3 Mon Sep 17 00:00:00 2001 From: Nikita Grigorian Date: Mon, 13 Apr 2026 13:28:31 -0700 Subject: [PATCH 3/3] fix spacing in changelog --- CHANGELOG.md | 1 - 1 file changed, 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9a53df8d1e..758e58790b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,7 +22,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Maintenance * Enabled multiversion documentation for `dpctl` using a custom drop-down for version selection and a `--multiversion` option for documentation build helper script [gh-2276](https://github.com/IntelPython/dpctl/pull/2276) - * Updated examples to remove use of `dpctl.tensor`, opting to simplify the examples and rely on `dpctl.memory` objects which wrap USM allocations [gh-2245](https://github.com/IntelPython/dpctl/pull/2245) * Removed deprecated property syntax from Cython files [gh-2277](https://github.com/IntelPython/dpctl/pull/2277)