12#include <cusolverDn.h>
30 [[nodiscard]]
int device() const noexcept {
return device_; }
31 [[nodiscard]] cusolverDnHandle_t
native_handle() const noexcept {
return handle_; }
37 void reset() noexcept;
40 cusolverDnHandle_t handle_ =
nullptr;
55 [[nodiscard]] explicit operator
bool() const noexcept
57 return static_cast<bool>(handle_) &&
static_cast<bool>(stream_);
63 void release() noexcept;
68 handle_lease_type handle_;
83 [[nodiscard]] std::optional<ExecutionLease> try_acquire();
85 [[nodiscard]]
int device() const noexcept {
return streams_->device(); }
86 [[nodiscard]] std::size_t
handle_count() const noexcept {
return handles_.size(); }
87 [[nodiscard]] std::size_t
idle_handle_count() const noexcept {
return handles_.idle_count(); }
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
Move-only pairing of one cuSOLVER handle slot and one idle stream.
Definition cusolver/execution.hpp:44
cuda::Stream const & stream() const noexcept
Definition cusolver/execution.hpp:60
HandleSlot & handle() const
Definition cusolver/execution.hpp:59
ExecutionLease() noexcept=default
Device-local cuSOLVER handle pool paired with the shared stream pool.
Definition cusolver/execution.hpp:75
std::size_t idle_handle_count() const noexcept
Definition cusolver/execution.hpp:87
std::size_t handle_count() const noexcept
Definition cusolver/execution.hpp:86
ExecutionPool & operator=(ExecutionPool &&)=delete
ExecutionPool(ExecutionPool const &)=delete
ExecutionPool & operator=(ExecutionPool const &)=delete
ExecutionPool(ExecutionPool &&)=delete
int device() const noexcept
Definition cusolver/execution.hpp:85
One reusable cuSOLVER handle and its handle-local state.
Definition cusolver/execution.hpp:21
~HandleSlot()
Definition cusolver/execution.cpp:93
cusolverDnHandle_t native_handle() const noexcept
Definition cusolver/execution.hpp:31
int device() const noexcept
Definition cusolver/execution.hpp:30
HandleSlot & operator=(HandleSlot const &)=delete
void bind(cuda::Stream const &stream)
Bind one operation stream to the exclusively leased handle.
Definition cusolver/execution.cpp:95
HandleSlot(HandleSlot const &)=delete
cuda::ResourceLease< HandleSlot > handle
Definition cublas/execution.cpp:33
Definition cusolver_error.cpp:10
ExecutionPool & execution_pool(cuda::DeviceResources &resources)
Return the lazily constructed cuSOLVER execution pool for one device.
Definition cusolver/execution.cpp:205
Fixed-capacity pools and move-only leases for CUDA provider resources.
CUDA device, stream, resource, and scoped runtime primitives.