nvidia/cuda: Add custom exception for CUDA

This commit is contained in:
Michael Fabian 'Xaymar' Dirks 2020-11-07 04:30:36 +01:00
parent 98f711523e
commit 9332d9377c

View file

@ -126,6 +126,19 @@ namespace nvidia::cuda {
array_format format;
};
class cuda_error : public std::exception {
::nvidia::cuda::result _code;
public:
cuda_error(::nvidia::cuda::result code) : _code(code) {}
~cuda_error(){};
::nvidia::cuda::result code()
{
return _code;
}
};
class cuda {
std::shared_ptr<util::library> _library;