25class ExecutionAcquireAwaiter;
38 [[nodiscard]]
int device() const noexcept {
return device_; }
41 [[nodiscard]] cublasHandle_t
native_handle() const noexcept {
return handle_; }
47 void reset() noexcept;
50 cublasHandle_t handle_ =
nullptr;
68 [[nodiscard]] explicit operator
bool() const noexcept
70 return static_cast<bool>(handle_) &&
static_cast<bool>(stream_);
80 void release() noexcept;
85 handle_lease_type handle_;
108 [[nodiscard]] std::optional<ExecutionLease> try_acquire();
114 [[nodiscard]]
int device() const noexcept {
return streams_->device(); }
117 [[nodiscard]] std::size_t
handle_count() const noexcept {
return handles_.size(); }
Awaiter that reserves a cuBLAS handle before waiting for an idle stream.
Definition cublas/task_awaiters.hpp:22
Move-only dynamic pairing of one cuBLAS handle slot and one idle stream.
Definition cublas/execution.hpp:56
cuda::Stream const & stream() const noexcept
Access the dynamically selected CUDA stream.
Definition cublas/execution.hpp:77
ExecutionLease() noexcept=default
HandleSlot & handle() const
Access the exclusively leased cuBLAS handle slot.
Definition cublas/execution.hpp:74
Device-local cuBLAS handle pool combined with a shared idle-stream pool.
Definition cublas/execution.hpp:98
int device() const noexcept
Return the CUDA device served by this execution pool.
Definition cublas/execution.hpp:114
std::size_t idle_handle_count() const noexcept
Return the number of currently idle provider handles.
Definition cublas/execution.hpp:120
ExecutionPool(ExecutionPool &&)=delete
ExecutionPool(ExecutionPool const &)=delete
std::size_t handle_count() const noexcept
Return the fixed number of provider handles.
Definition cublas/execution.hpp:117
ExecutionPool & operator=(ExecutionPool &&)=delete
ExecutionPool & operator=(ExecutionPool const &)=delete
One expensive reusable cuBLAS handle and its handle-local state.
Definition cublas/execution.hpp:28
void bind(cuda::Stream const &stream)
Establish deterministic host-pointer mode and bind one operation stream.
Definition cublas/execution.cpp:97
HandleSlot(HandleSlot const &)=delete
~HandleSlot()
Definition cublas/execution.cpp:95
HandleSlot & operator=(HandleSlot const &)=delete
cublasHandle_t native_handle() const noexcept
Return the raw handle for narrow provider-wrapper use.
Definition cublas/execution.hpp:41
int device() const noexcept
Return the device on which this handle was created.
Definition cublas/execution.hpp:38
Mutable stream and provider resources associated with one CUDA device.
Definition runtime.hpp:222
Fixed-capacity pool of preconstructed provider resources.
Definition resource_pool.hpp:96
Device-local pool whose streams become available only after their queued work completes.
Definition runtime.hpp:163
Reference-counted lease of one CUDA stream-pool slot.
Definition runtime.hpp:65
cuda::ResourceLease< HandleSlot > handle
Definition cublas/execution.cpp:33
Definition cublas_error.cpp:11
ExecutionPool & execution_pool(cuda::DeviceResources &resources)
Return the lazily constructed cuBLAS execution pool for one CUDA device.
Definition cublas/execution.cpp:215
Definition cublas/execution.hpp:18
Fixed-capacity pools and move-only leases for CUDA provider resources.
CUDA device, stream, resource, and scoped runtime primitives.