Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions cuda_bindings_12/cuda/bindings/cufile.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# SPDX-License-Identifier: Apache-2.0
#
# This code was automatically generated with version 12.9.1. Do not modify it directly.
# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=d258ab09c1e0f379fdda911b1088aaecef867845f2c2a93095a0a311679d95e2
# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=655aa3f4d39228f19b8eff38336deea991f07b766c3c6cb728a8cb811cb5e56e



Expand All @@ -26,8 +26,8 @@ ctypedef CUfileHandle_t Handle
ctypedef CUfileBatchHandle_t BatchHandle
ctypedef CUfileError_t Error
ctypedef cufileRDMAInfo_t RDMAInfo
ctypedef CUfileFSOps_t FSOps
ctypedef CUfileDrvProps_t DrvProps
ctypedef CUfileFSOps_t FSOps


###############################################################################
Expand Down
296 changes: 148 additions & 148 deletions cuda_bindings_12/cuda/bindings/cufile.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# SPDX-License-Identifier: Apache-2.0
#
# This code was automatically generated with version 12.9.1. Do not modify it directly.
# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=5c0f0ede5957fb7cbd597e6b23620fecb7128a0740b00a6313f8a4b1c79846f3
# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=865a4efd24ea9f23c4d6f195b4930ba426924724e91ce087bad87a6ecc43507d


# <<<< PREAMBLE CONTENT >>>>
Expand Down Expand Up @@ -615,6 +615,153 @@ cdef class IOEvents:
return obj


cdef _get__py_anon_pod2_dtype_offsets():
cdef cuda_bindings_cufile__anon_pod2 *pod = <cuda_bindings_cufile__anon_pod2 *>_cyb_calloc(1, sizeof(cuda_bindings_cufile__anon_pod2))
if pod == NULL:
raise MemoryError("Error allocating cuda_bindings_cufile__anon_pod2")
try:
return _numpy.dtype({
'names': ['batch'],
'formats': [_py_anon_pod3_dtype],
'offsets': [
(<intptr_t>&(pod.batch)) - (<intptr_t>pod),
],
'itemsize': sizeof(cuda_bindings_cufile__anon_pod2),
})
finally:
_cyb_free(pod)

_py_anon_pod2_dtype = _get__py_anon_pod2_dtype_offsets()

cdef class _py_anon_pod2:
"""Empty-initialize an instance of `cuda_bindings_cufile__anon_pod2`.


.. seealso:: `cuda_bindings_cufile__anon_pod2`
"""
cdef:
cuda_bindings_cufile__anon_pod2 *_ptr
object _owner
bint _owns_ptr
bint _readonly

def __init__(self):
self._ptr = <cuda_bindings_cufile__anon_pod2 *>_cyb_calloc(1, sizeof(cuda_bindings_cufile__anon_pod2))
if self._ptr == NULL:
raise MemoryError("Error allocating _py_anon_pod2")
self._owns_ptr = True
self._owner = None
self._readonly = False

def __dealloc__(self):
cdef cuda_bindings_cufile__anon_pod2 *ptr
if self._owns_ptr and self._ptr != NULL:
ptr = self._ptr
self._ptr = NULL
_cyb_free(ptr)

def __repr__(self):
return f"<{__name__}._py_anon_pod2 object at {hex(id(self))}>"

@property
def ptr(self):
"""Get the pointer address to the data as Python :class:`int`."""
return <intptr_t>(self._ptr)

cdef intptr_t _get_ptr(self):
return <intptr_t>(self._ptr)

def __int__(self):
return <intptr_t>(self._ptr)

def __eq__(self, other):
cdef _py_anon_pod2 other_
if not isinstance(other, _py_anon_pod2):
return False
other_ = other
return (_cyb_memcmp(<void *><intptr_t>(self._ptr), <void *><intptr_t>(other_._ptr), sizeof(cuda_bindings_cufile__anon_pod2)) == 0)

def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags):
_cyb___getbuffer(self, buffer, <void *>self._ptr, sizeof(cuda_bindings_cufile__anon_pod2), self._readonly)

def __releasebuffer__(self, Py_buffer *buffer):
pass

def __setitem__(self, key, val):
cdef _cyb_Py_buffer view
if key == 0:
if self._readonly:
raise ValueError("This _py_anon_pod2 instance is read-only")
_cyb_PyObject_GetBuffer(val, &view, _cyb_PyBUF_SIMPLE)
try:
if <size_t>view.len < sizeof(cuda_bindings_cufile__anon_pod2):
raise ValueError(
"source buffer too small: expected at least %d bytes, got %d" % (sizeof(cuda_bindings_cufile__anon_pod2), view.len)
)
_cyb_memmove(<void*>self._ptr, view.buf, sizeof(cuda_bindings_cufile__anon_pod2))
self._readonly = view.readonly != 0
finally:
_cyb_PyBuffer_Release(&view)
else:
setattr(self, key, val)

@property
def batch(self):
"""_py_anon_pod3: """
return _py_anon_pod3.from_ptr(
<intptr_t>&(self._ptr[0].batch),
readonly=self._readonly,
owner=self,
)

@batch.setter
def batch(self, val):
if self._readonly:
raise ValueError("This _py_anon_pod2 instance is read-only")
cdef _py_anon_pod3 val_ = val
_cyb_memcpy(<void *>&(self._ptr[0].batch), <void *>(val_._get_ptr()), sizeof(cuda_bindings_cufile__anon_pod3) * 1)

@staticmethod
def from_buffer(buffer):
"""Create an _py_anon_pod2 instance with the memory from the given buffer."""
return _cyb_from_buffer(buffer, sizeof(cuda_bindings_cufile__anon_pod2), _py_anon_pod2)

@staticmethod
def from_data(data):
"""Create an _py_anon_pod2 instance wrapping the given NumPy array.

Args:
data (_numpy.ndarray): a single-element array of dtype `_py_anon_pod2_dtype` holding the data.
"""
return _cyb_from_data(data, "_py_anon_pod2_dtype", _py_anon_pod2_dtype, _py_anon_pod2)

@staticmethod
def from_ptr(intptr_t ptr, bint readonly=False, object owner=None):
"""Create an _py_anon_pod2 instance wrapping the given pointer.

Args:
ptr (intptr_t): pointer address as Python :class:`int` to the data.
owner (object): The Python object that owns the pointer. If not provided, data will be copied.
readonly (bool): whether the data is read-only (to the user). default is `False`.
"""
if ptr == 0:
raise ValueError("ptr must not be null (0)")
cdef _py_anon_pod2 obj = _py_anon_pod2.__new__(_py_anon_pod2)
if owner is None:
obj._ptr = <cuda_bindings_cufile__anon_pod2 *>_cyb_malloc(sizeof(cuda_bindings_cufile__anon_pod2))
if obj._ptr == NULL:
raise MemoryError("Error allocating _py_anon_pod2")
_cyb_memcpy(<void*>(obj._ptr), <void*>ptr, sizeof(cuda_bindings_cufile__anon_pod2))
obj._owns_ptr = True
obj._owner = None
else:
obj._ptr = <cuda_bindings_cufile__anon_pod2 *>ptr
obj._owns_ptr = False
obj._owner = owner
obj._readonly = readonly
return obj


cdef _get_descr_dtype_offsets():
cdef CUfileDescr_t *pod = <CUfileDescr_t *>_cyb_calloc(1, sizeof(CUfileDescr_t))
if pod == NULL:
Expand Down Expand Up @@ -800,153 +947,6 @@ cdef class Descr:
return obj


cdef _get__py_anon_pod2_dtype_offsets():
cdef cuda_bindings_cufile__anon_pod2 *pod = <cuda_bindings_cufile__anon_pod2 *>_cyb_calloc(1, sizeof(cuda_bindings_cufile__anon_pod2))
if pod == NULL:
raise MemoryError("Error allocating cuda_bindings_cufile__anon_pod2")
try:
return _numpy.dtype({
'names': ['batch'],
'formats': [_py_anon_pod3_dtype],
'offsets': [
(<intptr_t>&(pod.batch)) - (<intptr_t>pod),
],
'itemsize': sizeof(cuda_bindings_cufile__anon_pod2),
})
finally:
_cyb_free(pod)

_py_anon_pod2_dtype = _get__py_anon_pod2_dtype_offsets()

cdef class _py_anon_pod2:
"""Empty-initialize an instance of `cuda_bindings_cufile__anon_pod2`.


.. seealso:: `cuda_bindings_cufile__anon_pod2`
"""
cdef:
cuda_bindings_cufile__anon_pod2 *_ptr
object _owner
bint _owns_ptr
bint _readonly

def __init__(self):
self._ptr = <cuda_bindings_cufile__anon_pod2 *>_cyb_calloc(1, sizeof(cuda_bindings_cufile__anon_pod2))
if self._ptr == NULL:
raise MemoryError("Error allocating _py_anon_pod2")
self._owns_ptr = True
self._owner = None
self._readonly = False

def __dealloc__(self):
cdef cuda_bindings_cufile__anon_pod2 *ptr
if self._owns_ptr and self._ptr != NULL:
ptr = self._ptr
self._ptr = NULL
_cyb_free(ptr)

def __repr__(self):
return f"<{__name__}._py_anon_pod2 object at {hex(id(self))}>"

@property
def ptr(self):
"""Get the pointer address to the data as Python :class:`int`."""
return <intptr_t>(self._ptr)

cdef intptr_t _get_ptr(self):
return <intptr_t>(self._ptr)

def __int__(self):
return <intptr_t>(self._ptr)

def __eq__(self, other):
cdef _py_anon_pod2 other_
if not isinstance(other, _py_anon_pod2):
return False
other_ = other
return (_cyb_memcmp(<void *><intptr_t>(self._ptr), <void *><intptr_t>(other_._ptr), sizeof(cuda_bindings_cufile__anon_pod2)) == 0)

def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags):
_cyb___getbuffer(self, buffer, <void *>self._ptr, sizeof(cuda_bindings_cufile__anon_pod2), self._readonly)

def __releasebuffer__(self, Py_buffer *buffer):
pass

def __setitem__(self, key, val):
cdef _cyb_Py_buffer view
if key == 0:
if self._readonly:
raise ValueError("This _py_anon_pod2 instance is read-only")
_cyb_PyObject_GetBuffer(val, &view, _cyb_PyBUF_SIMPLE)
try:
if <size_t>view.len < sizeof(cuda_bindings_cufile__anon_pod2):
raise ValueError(
"source buffer too small: expected at least %d bytes, got %d" % (sizeof(cuda_bindings_cufile__anon_pod2), view.len)
)
_cyb_memmove(<void*>self._ptr, view.buf, sizeof(cuda_bindings_cufile__anon_pod2))
self._readonly = view.readonly != 0
finally:
_cyb_PyBuffer_Release(&view)
else:
setattr(self, key, val)

@property
def batch(self):
"""_py_anon_pod3: """
return _py_anon_pod3.from_ptr(
<intptr_t>&(self._ptr[0].batch),
readonly=self._readonly,
owner=self,
)

@batch.setter
def batch(self, val):
if self._readonly:
raise ValueError("This _py_anon_pod2 instance is read-only")
cdef _py_anon_pod3 val_ = val
_cyb_memcpy(<void *>&(self._ptr[0].batch), <void *>(val_._get_ptr()), sizeof(cuda_bindings_cufile__anon_pod3) * 1)

@staticmethod
def from_buffer(buffer):
"""Create an _py_anon_pod2 instance with the memory from the given buffer."""
return _cyb_from_buffer(buffer, sizeof(cuda_bindings_cufile__anon_pod2), _py_anon_pod2)

@staticmethod
def from_data(data):
"""Create an _py_anon_pod2 instance wrapping the given NumPy array.

Args:
data (_numpy.ndarray): a single-element array of dtype `_py_anon_pod2_dtype` holding the data.
"""
return _cyb_from_data(data, "_py_anon_pod2_dtype", _py_anon_pod2_dtype, _py_anon_pod2)

@staticmethod
def from_ptr(intptr_t ptr, bint readonly=False, object owner=None):
"""Create an _py_anon_pod2 instance wrapping the given pointer.

Args:
ptr (intptr_t): pointer address as Python :class:`int` to the data.
owner (object): The Python object that owns the pointer. If not provided, data will be copied.
readonly (bool): whether the data is read-only (to the user). default is `False`.
"""
if ptr == 0:
raise ValueError("ptr must not be null (0)")
cdef _py_anon_pod2 obj = _py_anon_pod2.__new__(_py_anon_pod2)
if owner is None:
obj._ptr = <cuda_bindings_cufile__anon_pod2 *>_cyb_malloc(sizeof(cuda_bindings_cufile__anon_pod2))
if obj._ptr == NULL:
raise MemoryError("Error allocating _py_anon_pod2")
_cyb_memcpy(<void*>(obj._ptr), <void*>ptr, sizeof(cuda_bindings_cufile__anon_pod2))
obj._owns_ptr = True
obj._owner = None
else:
obj._ptr = <cuda_bindings_cufile__anon_pod2 *>ptr
obj._owns_ptr = False
obj._owner = owner
obj._readonly = readonly
return obj


cdef _get_io_params_dtype_offsets():
cdef CUfileIOParams_t *pod = <CUfileIOParams_t *>_cyb_calloc(1, sizeof(CUfileIOParams_t))
if pod == NULL:
Expand Down
26 changes: 13 additions & 13 deletions cuda_bindings_12/cuda/bindings/cycufile.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# SPDX-License-Identifier: Apache-2.0
#
# This code was automatically generated with version 12.9.1. Do not modify it directly.
# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=3eb9d86dd8b3d2b8b241bc23f2706f73b456a6d9eab5a83d910a9057ce0a8ab2
# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=3b8b25417027fecbe1f002168775e688c2af62826825699a84a775ab43c46b23


# <<<< PREAMBLE CONTENT >>>>
Expand Down Expand Up @@ -202,14 +202,6 @@ cdef extern from 'cufile.h':
int desc_len
char* desc_str

cdef extern from 'cufile.h':
ctypedef struct CUfileFSOps_t 'CUfileFSOps_t':
char* (*fs_type)(void*)
int (*getRDMADeviceList)(void*, sockaddr_t**)
int (*getRDMADevicePriority)(void*, char*, size_t, loff_t, sockaddr_t*)
ssize_t (*read)(void*, char*, size_t, loff_t, cufileRDMAInfo_t*)
ssize_t (*write)(void*, const char*, size_t, loff_t, cufileRDMAInfo_t*)

cdef extern from 'cufile.h':
ctypedef union cuda_bindings_cufile__anon_pod1 "std::remove_all_extents<decltype(((CUfileDescr_t*)0)->handle)>::type":
int fd
Expand Down Expand Up @@ -239,15 +231,23 @@ cdef extern from 'cufile.h':
unsigned int max_batch_io_timeout_msecs

cdef extern from 'cufile.h':
ctypedef struct CUfileDescr_t 'CUfileDescr_t':
CUfileFileHandleType type
cuda_bindings_cufile__anon_pod1 handle
CUfileFSOps_t* fs_ops
ctypedef struct CUfileFSOps_t 'CUfileFSOps_t':
char* (*fs_type)(void*)
int (*getRDMADeviceList)(void*, sockaddr_t**)
int (*getRDMADevicePriority)(void*, char*, size_t, loff_t, sockaddr_t*)
ssize_t (*read)(void*, char*, size_t, loff_t, cufileRDMAInfo_t*)
ssize_t (*write)(void*, const char*, size_t, loff_t, cufileRDMAInfo_t*)

cdef extern from 'cufile.h':
ctypedef union cuda_bindings_cufile__anon_pod2 "std::remove_all_extents<decltype(((CUfileIOParams_t*)0)->u)>::type":
cuda_bindings_cufile__anon_pod3 batch

cdef extern from 'cufile.h':
ctypedef struct CUfileDescr_t 'CUfileDescr_t':
CUfileFileHandleType type
cuda_bindings_cufile__anon_pod1 handle
CUfileFSOps_t* fs_ops

cdef extern from 'cufile.h':
ctypedef struct CUfileIOParams_t 'CUfileIOParams_t':
CUfileBatchMode_t mode
Expand Down
Loading
Loading