|
Uni20
Asynchronous tensor and runtime library.
|
Classes | |
| class | CublasError |
| Exception carrying a failed cuBLAS operation and device identity. More... | |
| class | ExecutionAcquireAwaiter |
| Awaiter that reserves a cuBLAS handle before waiting for an idle stream. More... | |
| class | ExecutionLease |
| Move-only dynamic pairing of one cuBLAS handle slot and one idle stream. More... | |
| class | ExecutionPool |
| Device-local cuBLAS handle pool combined with a shared idle-stream pool. More... | |
| class | HandleSlot |
| One expensive reusable cuBLAS handle and its handle-local state. More... | |
Concepts | |
| concept | CublasScalar |
| Scalar types supported by the cuBLAS GEMM wrappers. | |
| concept | CublasLevelOneScalar |
| Scalar types supported by the cuBLAS level-one wrappers. | |
Functions | |
| ExecutionAcquireAwaiter | acquire_execution (ExecutionPool &pool) noexcept |
| Acquire a cuBLAS handle and idle stream without blocking a CUDA task. | |
| void | check (cublasStatus_t status, std::string_view operation, int device, std::source_location where=std::source_location::current()) |
Raise unless a cuBLAS call returned CUBLAS_STATUS_SUCCESS. | |
| presentation::report_builder | diagnostic_report (CublasError const &error) |
| Build a presentation report for a cuBLAS provider failure. | |
| template<CublasLevelOneScalar Scalar> | |
| auto | dotc (ExecutionLease &execution, int size, Scalar const *lhs, Scalar const *rhs) -> Scalar |
| Compute the conjugate-linear dot product and return a host scalar. | |
| ExecutionPool & | execution_pool (cuda::DeviceResources &resources) |
| Return the lazily constructed cuBLAS execution pool for one CUDA device. | |
| ExecutionPool & | execution_pool (cuda::DeviceResources &resources, std::size_t handle_count) |
| Configure or return the canonical cuBLAS execution pool for one device. | |
| template<CublasScalar Scalar> | |
| void | gemm (ExecutionLease &execution, char lhs_transform, char rhs_transform, int rows, int cols, int inner, Scalar alpha, Scalar const *lhs, int lhs_leading_dimension, Scalar const *rhs, int rhs_leading_dimension, Scalar beta, Scalar *output, int output_leading_dimension) |
| Enqueue column-major GEMM through an exclusive handle/stream lease. | |
| template<CublasLevelOneScalar Scalar> | |
| auto | nrm2 (ExecutionLease &execution, int size, Scalar const *input) -> uni20::make_real_t< Scalar > |
| Compute a Euclidean norm and return a host real scalar. | |
| void | raise_error (cublasStatus_t status, std::string_view operation, int device, std::source_location where=std::source_location::current()) |
| Raise a structured cuBLAS provider failure. | |
| std::string_view | status_name (cublasStatus_t status) noexcept |
| Return a stable symbolic name for a cuBLAS status value. | |
|
inlinenoexcept |
Acquire a cuBLAS handle and idle stream without blocking a CUDA task.
| void uni20::cublas::check | ( | cublasStatus_t | status, |
| std::string_view | operation, | ||
| int | device, | ||
| std::source_location | where | ||
| ) |
Raise unless a cuBLAS call returned CUBLAS_STATUS_SUCCESS.
|
inline |
Build a presentation report for a cuBLAS provider failure.
| auto uni20::cublas::dotc | ( | ExecutionLease & | execution, |
| int | size, | ||
| Scalar const * | lhs, | ||
| Scalar const * | rhs | ||
| ) | -> Scalar |
Compute the conjugate-linear dot product and return a host scalar.
The provider call uses host pointer mode. The operation stream is synchronized before the host result and any borrowed input storage may leave scope.
| ExecutionPool & uni20::cublas::execution_pool | ( | cuda::DeviceResources & | resources | ) |
Return the lazily constructed cuBLAS execution pool for one CUDA device.
The device resources own the pool and retain it until after every Tensor and operation using those resources has finished. Unless the pool was configured explicitly, it contains one handle per stream.
| ExecutionPool & uni20::cublas::execution_pool | ( | cuda::DeviceResources & | resources, |
| std::size_t | handle_count | ||
| ) |
Configure or return the canonical cuBLAS execution pool for one device.
This first-use configuration must precede concurrent provider use. Repeated calls must request the same handle count. The handle count cannot exceed the device's stream capacity.
| resources | Device resources that own the canonical pool. |
| handle_count | Number of reusable cuBLAS handles. |
| void uni20::cublas::gemm | ( | ExecutionLease & | execution, |
| char | lhs_transform, | ||
| char | rhs_transform, | ||
| int | rows, | ||
| int | cols, | ||
| int | inner, | ||
| Scalar | alpha, | ||
| Scalar const * | lhs, | ||
| int | lhs_leading_dimension, | ||
| Scalar const * | rhs, | ||
| int | rhs_leading_dimension, | ||
| Scalar | beta, | ||
| Scalar * | output, | ||
| int | output_leading_dimension | ||
| ) |
Enqueue column-major GEMM through an exclusive handle/stream lease.
| auto uni20::cublas::nrm2 | ( | ExecutionLease & | execution, |
| int | size, | ||
| Scalar const * | input | ||
| ) | -> uni20::make_real_t<Scalar> |
Compute a Euclidean norm and return a host real scalar.
The operation stream is synchronized before the result returns.
| void uni20::cublas::raise_error | ( | cublasStatus_t | status, |
| std::string_view | operation, | ||
| int | device, | ||
| std::source_location | where | ||
| ) |
Raise a structured cuBLAS provider failure.
|
noexcept |
Return a stable symbolic name for a cuBLAS status value.