Skip to navigation

holoscan::CudaStreamAllocator

Beta
View as Markdown

CUDA-specific allocator extension for stream-ordered allocation and release.

Keeping this separate from Allocator lets CPU/system allocators avoid CUDA stream concepts while CUDA-backed Tensor storage can still pass CCCL stream references through the native Holoscan API.

#include <holoscan/cuda_stream_allocator.hpp>

Inherits from: holoscan::Allocator (public)


Constructors

Destructor

~CudaStreamAllocator

holoscan::CudaStreamAllocator::~CudaStreamAllocator() override = default

Methods

allocate_async

expected<std::byte *, Error> holoscan::CudaStreamAllocator::allocate_async(
uint64_t size,
MemoryStorageType storage_type,
cudaStream_t stream
)

free_async

expected<void, Error> holoscan::CudaStreamAllocator::free_async(
std::byte *pointer,
cudaStream_t stream
)

is_available

virtual expected<void, Error> holoscan::CudaStreamAllocator::is_available(
uint64_t size,
MemoryStorageType storage_type
)

allocate

virtual expected<std::byte *, Error> holoscan::CudaStreamAllocator::allocate(
uint64_t size,
MemoryStorageType storage_type
)

free

virtual expected<void, Error> holoscan::CudaStreamAllocator::free(
std::byte *pointer
)

block_size

virtual uint64_t holoscan::CudaStreamAllocator::block_size(
MemoryStorageType storage_type
) const

device_id

virtual int32_t holoscan::CudaStreamAllocator::device_id(
MemoryStorageType storage_type
) const

allocate_async_impl

virtual expected<std::byte *, Error> holoscan::CudaStreamAllocator::allocate_async_impl(
uint64_t size,
MemoryStorageType storage_type,
cudaStream_t stream
)

free_async_impl

virtual expected<void, Error> holoscan::CudaStreamAllocator::free_async_impl(
std::byte *pointer,
cudaStream_t stream
)

Member variables

NameTypeDescription
kUnknownDeviceId static constexprint32_t