错误

group Errors
struct logic_error : public std::logic_error
#include <error.hpp>

当逻辑前置条件被违反时抛出的异常。

不应直接抛出此异常,而是通过 RMM_EXPECTS 宏抛出。

struct cuda_error : public std::runtime_error
#include <error.hpp>

遇到 CUDA 错误时抛出的异常。

class bad_alloc : public std::bad_alloc
#include <error.hpp>

RMM 分配失败时抛出的异常。

rmm::out_of_memory 派生而来

公共函数

inline bad_alloc(const char *msg)

构造一个带有错误消息的 bad_alloc

参数:

msg – 与异常关联的消息

inline bad_alloc(std::string const &msg)

构造一个带有错误消息的 bad_alloc

参数:

msg – 与异常关联的消息

inline const char *what() const noexcept override

解释性字符串。

返回值:

解释性字符串

class out_of_memory : public rmm::bad_alloc
#include <error.hpp>

RMM 内存不足时抛出的异常。

仅当我们确定资源内存不足时才应抛出此错误。

公共函数

inline out_of_memory(const char *msg)

构造一个带有错误消息的 out_of_memory

参数:

msg – 与异常关联的消息

inline out_of_memory(std::string const &msg)

构造一个带有错误消息的 out_of_memory

参数:

msg – 与异常关联的消息

class out_of_range : public std::out_of_range
#include <error.hpp>

尝试访问定义范围之外时抛出的异常。