Loading...
Searching...
No Matches
error.hpp
1/*
2 * SPDX-FileCopyrightText: Copyright (c) 2020-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3 * SPDX-License-Identifier: Apache-2.0
4 */
5
6#pragma once
7
8#include <rmm/detail/export.hpp>
9
10#include <stdexcept>
11#include <string>
12
13RMM_NAMESPACE_BEGIN
14
24struct logic_error : public std::logic_error {
25 using std::logic_error::logic_error;
26};
27
34struct cuda_error : public std::runtime_error {
35 using std::runtime_error::runtime_error;
36};
37
44class bad_alloc : public std::bad_alloc {
45 public:
51 bad_alloc(const char* msg);
52
58 bad_alloc(std::string const& msg);
59
63 [[nodiscard]] const char* what() const noexcept override;
64
65 private:
66 std::string _what;
67};
68
76class out_of_memory : public bad_alloc {
77 public:
83 out_of_memory(const char* msg);
84
90 out_of_memory(std::string const& msg);
91};
92
99class out_of_range : public std::out_of_range {
100 using std::out_of_range::out_of_range;
101};
102
108class invalid_argument : public std::invalid_argument {
109 using std::invalid_argument::invalid_argument;
110};
111
112RMM_NAMESPACE_END
const char * what() const noexcept override
The explanatory string.
bad_alloc(std::string const &msg)
Constructs a bad_alloc with the error message.
bad_alloc(const char *msg)
Constructs a bad_alloc with the error message.
Exception thrown when an argument to a function is invalid.
Definition error.hpp:108
out_of_memory(std::string const &msg)
Constructs an out_of_memory with the error message.
out_of_memory(const char *msg)
Constructs an out_of_memory with the error message.
Exception thrown when attempting to access outside of a defined range.
Definition error.hpp:99
Exception thrown when a CUDA error is encountered.
Definition error.hpp:34
Exception thrown when logical precondition is violated.
Definition error.hpp:24