Uni20
Asynchronous tensor and runtime library.
Loading...
Searching...
No Matches
cuda_error_presentation.hpp
Go to the documentation of this file.
1#pragma once
2
11
12#include <fmt/core.h>
13
14namespace uni20::cuda
15{
16
19{
21 report.status(presentation::semantic_glyph::failure, fmt::format("CUDA operation '{}' failed", error.operation()));
22 report.field("Status", fmt::format("{} ({})", error.error_name(), static_cast<int>(error.status())));
23 report.field("Reason", error.reason());
24 if (error.device().has_value())
25 {
26 report.field("Device", *error.device());
27 }
28 return report;
29}
30
31} // namespace uni20::cuda
Exception carrying a failed CUDA runtime operation and status.
Definition cuda_error.hpp:22
Builder for simple terminal reports with headings, status lines, fields, and tables.
Definition presentation.hpp:602
report_builder & field(std::string key, std::string value)
Add a labeled field to the report header.
Definition presentation.cpp:1459
report_builder & status(semantic_glyph glyph, std::string label)
Add a semantic status line such as ✓ converged.
Definition presentation.cpp:1453
Structured CUDA runtime failures and checked-call helpers.
Definition cublas/execution.hpp:18
presentation::report_builder diagnostic_report(CudaRuntimeError const &error)
Build a presentation report for a CUDA runtime failure.
Definition cuda_error_presentation.hpp:18