Uni20
Asynchronous tensor and runtime library.
Loading...
Searching...
No Matches
Public Member Functions | Friends | List of all members
uni20::cublas::ExecutionPool Class Reference

Device-local cuBLAS handle pool combined with a shared idle-stream pool. More...

#include <execution.hpp>

Public Member Functions

ExecutionLease acquire ()
 Block until a handle and then an idle stream are available.
 
int device () const noexcept
 Return the CUDA device served by this execution pool.
 
 ExecutionPool (cuda::StreamPool &streams, std::size_t handle_count)
 Construct handle_count cuBLAS handles for the stream pool's device.
 
 ExecutionPool (ExecutionPool &&)=delete
 
 ExecutionPool (ExecutionPool const &)=delete
 
std::size_t handle_count () const noexcept
 Return the fixed number of provider handles.
 
std::size_t idle_handle_count () const noexcept
 Return the number of currently idle provider handles.
 
ExecutionPool & operator= (ExecutionPool &&)=delete
 
ExecutionPool & operator= (ExecutionPool const &)=delete
 
std::optional< ExecutionLease > try_acquire ()
 Try to acquire a handle and stream without waiting.
 

Friends

class ExecutionAcquireAwaiter
 

Detailed Description

Device-local cuBLAS handle pool combined with a shared idle-stream pool.

Handle slots and streams are independent persistent pools. Each execution acquisition reserves a handle first, then obtains an actually-idle stream and returns the temporary pair. The execution pool and its stream pool must outlive all leases and deferred handle returns.

Constructor & Destructor Documentation

◆ ExecutionPool() [1/3]

uni20::cublas::ExecutionPool::ExecutionPool ( cuda::StreamPool &  streams,
std::size_t  handle_count 
)

Construct handle_count cuBLAS handles for the stream pool's device.

◆ ExecutionPool() [2/3]

uni20::cublas::ExecutionPool::ExecutionPool ( ExecutionPool const &  )
delete

◆ ExecutionPool() [3/3]

uni20::cublas::ExecutionPool::ExecutionPool ( ExecutionPool &&  )
delete

Member Function Documentation

◆ acquire()

ExecutionLease uni20::cublas::ExecutionPool::acquire ( )

Block until a handle and then an idle stream are available.

◆ device()

int uni20::cublas::ExecutionPool::device ( ) const
inlinenoexcept

Return the CUDA device served by this execution pool.

◆ handle_count()

std::size_t uni20::cublas::ExecutionPool::handle_count ( ) const
inlinenoexcept

Return the fixed number of provider handles.

◆ idle_handle_count()

std::size_t uni20::cublas::ExecutionPool::idle_handle_count ( ) const
inlinenoexcept

Return the number of currently idle provider handles.

◆ operator=() [1/2]

ExecutionPool & uni20::cublas::ExecutionPool::operator= ( ExecutionPool &&  )
delete

◆ operator=() [2/2]

ExecutionPool & uni20::cublas::ExecutionPool::operator= ( ExecutionPool const &  )
delete

◆ try_acquire()

std::optional< ExecutionLease > uni20::cublas::ExecutionPool::try_acquire ( )

Try to acquire a handle and stream without waiting.

Friends And Related Symbol Documentation

◆ ExecutionAcquireAwaiter

friend class ExecutionAcquireAwaiter
friend

The documentation for this class was generated from the following files: