cubie.memory.array_requests
Array request and response data structures for memory management.
This module provides data structures for requesting and managing GPU memory allocations with specific shapes, data types, and memory location requirements.
Classes
|
Specification for requesting array allocation with shape, dtype, and memory location. |
|
Result of an array allocation containing arrays and chunking information. |
- class cubie.memory.array_requests.ArrayRequest(shape: tuple[int, ...] = (1, 1, 1), dtype=<class 'numpy.float64'>, memory: str = 'device', stride_order: tuple[str, ...] | None = None)[source]
Bases:
object
Specification for requesting array allocation with shape, dtype, and memory location.
- Parameters:
shape (tuple of int, default (1, 1, 1)) – The shape of the requested array.
dtype (numpy.dtype, default np.float64) – The data type for the array elements.
memory (str, default "device") – Memory location type. Must be one of “device”, “mapped”, “pinned”, or “managed”.
stride_order (tuple of str or None, default None) – The order of strides for the array dimensions. If None, will be set automatically based on shape length.
- dtype
The data type for the array elements.
- Type:
- Properties
- ----------
Notes
When stride_order is None, it will be automatically set during initialization: - For 3D arrays: (“time”, “run”, “variable”) - For 2D arrays: (“variable”, “run”)
- dtype
- property size
Calculate the total size of the array in bytes.
- Returns:
Total size in bytes including element size and shape.
- Return type:
- class cubie.memory.array_requests.ArrayResponse(arr: dict[str, FakeCUDAArray] = NOTHING, chunks: int = NOTHING, chunk_axis: str = 'run')[source]
Bases:
object
Result of an array allocation containing arrays and chunking information.
- Parameters: