Skip to content
Draft
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
3 changes: 2 additions & 1 deletion iris/allocators/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@
from .base import BaseAllocator
from .torch_allocator import TorchAllocator
from .vmem_allocator import VMemAllocator
from .vmem_pow2_allocator import VMemPow2Allocator

__all__ = ["BaseAllocator", "TorchAllocator", "VMemAllocator"]
__all__ = ["BaseAllocator", "TorchAllocator", "VMemAllocator", "VMemPow2Allocator"]
10 changes: 6 additions & 4 deletions iris/allocators/vmem_allocator.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,14 +107,16 @@ def get_allocation_segments(self):
Get list of allocation segments for segmented DMA-BUF export.

Returns:
List of (offset, size, va) tuples for each allocation in order.
Each tuple describes one physically-backed segment that needs
to be exported/imported separately.
List of ``(offset, size, va, generation)`` tuples for each
allocation in order. Each tuple describes one physically-backed
segment that needs to be exported/imported separately.
*generation* is always ``0`` for this allocator since it never
remaps a VA with fresh physical memory.
"""
segments = []
for offset, size in self.allocation_order:
va = self.base_va + offset
segments.append((offset, size, va))
segments.append((offset, size, va, 0))
return segments

def get_minimum_allocation_size(self) -> int:
Expand Down
Loading