cl::sycl::exception Class Reference
SYCL exception class, defined Section 3.2 of the specification, for general SYCL error. More...
#include <error.h>
Public Member Functions | |
const char * | what () const noexcept |
Overload of std::runtime_error::what() which returns the message associated with the error. More... | |
bool | has_context () const noexcept |
Reports whether the exception has a context associated with it. More... | |
cl::sycl::context | get_context () const |
Returns the SYCL context that is associated with this SYCL exception. More... | |
cl_int | get_cl_code () const |
Returns the OpenCL error code. More... | |
Protected Member Functions | |
exception (detail::impl_constructor_tag, std::error_code errorCode, const char *whatArg) | |
exception (detail::impl_constructor_tag, context ctx, std::error_code errorCode, const char *whatArg) | |
const std::error_code & | get_log_errc () const noexcept |
Returns the error_code from inside the member sycl_log to avoid leaking the full log definition. More... | |
Detailed Description
SYCL exception class, defined Section 3.2 of the specification, for general SYCL error.
This implementation adds extra methods to those defined in the specification to provide additional information to the user.
Constructor & Destructor Documentation
◆ exception() [1/2]
|
protected |
◆ exception() [2/2]
|
protected |
Member Function Documentation
◆ get_cl_code()
cl_int cl::sycl::exception::get_cl_code | ( | ) | const |
Returns the OpenCL error code.
Value extracted directly from the OpenCL header.
- Returns
- int OpenCL error code
◆ get_context()
cl::sycl::context cl::sycl::exception::get_context | ( | ) | const |
Returns the SYCL context that is associated with this SYCL exception.
If no context is associated with this exception, it throws a new exception.
- Returns
- Context that is associated with this exception
◆ get_log_errc()
|
protectednoexcept |
Returns the error_code from inside the member sycl_log to avoid leaking the full log definition.
- Returns
- const ref to an std::error_code
◆ has_context()
|
noexcept |
Reports whether the exception has a context associated with it.
- Returns
- True if a context is associated with this exception
◆ what()
|
noexcept |
Overload of std::runtime_error::what() which returns the message associated with the error.
- Returns
- The message associated with the error.
The documentation for this class was generated from the following file: