libSCALE  0.2.0
A modern C++ CUDA API
sp::CudaException Class Reference

Base class for exception types that wrap CUDA error codes. More...

#include <Exception.hpp>

Inheritance diagram for sp::CudaException:
[legend]

Public Member Functions

 CudaException (cudaError_t e)
 
 CudaException (cudaError_t e, const std::string desc)
 
 CudaException (const CudaException &)
 
cudaError_t getErrorCode () const
 Get the cudaError_t corresponding to this error. More...
 
- Public Member Functions inherited from std::runtime_error
runtime_error (T... args)
 
what (T... args)
 
- Public Member Functions inherited from std::exception
exception (T... args)
 
operator= (T... args)
 
what (T... args)
 
~exception (T... args)
 

Detailed Description

Base class for exception types that wrap CUDA error codes.

There's a subclass of this for every CUDA error type, see below.

Generating an exception type for every CUDA error code allows you to catch and handle specific errors, while letting unexpected ones continue to propagate.

See also
sp::throwCudaException()
sp::CudaExceptionFor()

Member Function Documentation

◆ getErrorCode()

cudaError_t sp::CudaException::getErrorCode ( ) const

Get the cudaError_t corresponding to this error.