|
cuSBF
|
#include <cuda_runtime.h>#include <cuda/std/expected>#include <cstdint>#include <cstdio>#include <format>#include <source_location>#include <stdexcept>#include <string>#include <string_view>#include <type_traits>#include <utility>#include <variant>Go to the source code of this file.
Classes | |
| struct | cusbf::SourceLocation |
| File, line, and column for a C++ call site or FASTX input position. More... | |
| struct | cusbf::CudaError |
| struct | cusbf::IoError |
| struct | cusbf::FastxParseError |
| struct | cusbf::InvalidArgumentError |
| struct | cusbf::ResourceError |
| struct | cusbf::Error |
| Error payload carried in Result on failure. More... | |
| struct | cusbf::Result< T > |
Fallible API result: cuda::std::expected<T, Error> with cuSBF factories. More... | |
| struct | cusbf::Result< void > |
Namespaces | |
| namespace | cusbf |
| namespace | cusbf::detail |
Macros | |
| #define | CUSBF_TRY(expr) |
| Propagates a cusbf::Result failure from the enclosing function (GNU statement expression). | |
| #define | CUSBF_UNWRAP(expr) |
Unwraps a cusbf::Result or throws std::runtime_error on failure (tests and apps). | |
| #define | CUSBF_CUDA_ABORT(expr) ::cusbf::cuda_abort_on_error((expr)) |
| Checks a CUDA call and aborts on failure (destructors and RAII only). | |
| #define | CUSBF_CUDA_TRY(expr) CUSBF_TRY(::cusbf::cuda_try((expr))) |
| Propagates a CUDA error wrapped in cusbf::Result<void>. | |
Enumerations | |
| enum class | cusbf::ErrorCategory : uint8_t { cusbf::cuda , cusbf::io , cusbf::fastx_parse , cusbf::invalid_argument , cusbf::resource } |
| Error category for Result failures. More... | |
Functions | |
| void | cusbf::require_void (const Result< void > &result) |
| Aborts when a Result is unsuccessful (benchmarks and tests). | |
| void | cusbf::cuda_abort_on_error (cudaError_t error, std::source_location location=std::source_location::current()) |
Terminates the process when error is not cudaSuccess (for RAII teardown only). | |
| template<typename T > | |
| T | cusbf::detail::try_unwrap_success (Result< T > &result) |
| void | cusbf::detail::try_unwrap_success (Result< void > &result) |
| cuda::std::unexpected< Error > | cusbf::detail::propagate_error (const Error &error) |
Copies error for propagation (avoids moving out of expected::error()). | |
| cuda::std::unexpected< Error > | cusbf::Err (Error error) |
Failure return; converts to any Result<T> via cuda::std::unexpected. | |
| Result< void > | cusbf::Ok () noexcept |
Success return for Result<void>; same as return {}. | |
| Result< void > | cusbf::cuda_try (cudaError_t error, std::source_location location=std::source_location::current()) |
| Checks a CUDA runtime call and returns an error on failure. | |
| #define CUSBF_CUDA_ABORT | ( | expr | ) | ::cusbf::cuda_abort_on_error((expr)) |
| #define CUSBF_CUDA_TRY | ( | expr | ) | CUSBF_TRY(::cusbf::cuda_try((expr))) |
Propagates a CUDA error wrapped in cusbf::Result<void>.
| #define CUSBF_TRY | ( | expr | ) |
Propagates a cusbf::Result failure from the enclosing function (GNU statement expression).
On failure, copies the error then returns cuda::std::unexpected<Error> (does not move out of the source expected). On success, yields the value for valued results, or nothing for Result<void>. Usable as a statement (CUSBF_TRY(expr);) or in initializers (auto x = CUSBF_TRY(expr);).
Definition at line 246 of file error.hpp.
| #define CUSBF_UNWRAP | ( | expr | ) |
Unwraps a cusbf::Result or throws std::runtime_error on failure (tests and apps).
Definition at line 256 of file error.hpp.