Exception Classification#

Exception classification in oneIPL is aligned with the C++ Standard Library classification. oneIPL introduces a class that defines the base class in the hierarchy of oneIPL exception classes. All oneIPL functions throw exceptions inherited from this base class. In the hierarchy of oneIPL exceptions, oneapi::ipl::exception is the base class. All other oneIPL exception classes are derived from this base class and from the std::exception class or one of its child classes.

Common Exceptions#

Exception class

Description

oneapi::ipl::exception

Abstract class, base for all other oneIPL exception classes

oneapi::ipl::logic_error

Abstract class, base for all oneIPL exception classes on logic errors (that are a consequence of faulty logic within the program)

oneapi::ipl::runtime_error

Abstract class, base for all oneIPL exception classes on runtime errors (that are due to events beyond the scope of the program)

oneapi::ipl::invalid_argument

Reports a problem when arguments to the function were rejected

oneapi::ipl::domain_error

Reports a problem when inputs are outside of the domain on which a function is defined

oneapi::ipl::out_of_range

Reports a problem when there is an attempt to access element(s) outside a defined range

oneapi::ipl::range_error

Reports a problem when a result of a computation cannot be represented by the destination type

oneapi::ipl::bad_alloc

Base class for all oneIPL exception classes for bad allocation errors; reports a problem when an allocation function has failed to allocate storage

oneapi::ipl::host_bad_alloc

Reports a problem that occurred during memory allocation on the host

oneapi::ipl::device_bad_alloc

Reports a problem that occurred during memory allocation on a specific device

oneapi::ipl::unsupported_device

Reports a problem when the function is not supported on a specific device

oneapi::ipl::unimplemented

Reports a problem when a specific function has not been implemented for the specified parameters

oneapi::ipl::uninitialized

Reports a problem when an object has not been initialized