error_accessor Class#

Description

The error_accessor class provides access, either on the host or on a device, to the state of the error flag handled by the corresponding error handler. To construct an object of this class, call the method error_handler<ErrorEnumT>::get_access() (error_handler class).

Include Files

oneapi/ipl.hpp

Domain Dependencies

Headers: oneapi/ipl.hpp

Libraries: oneipl.lib

Syntax

template<typename ErrorEnumT, sycl::access_mode AccessMode, bool IsHost>
class error_accessor#

This class provides an access (either on host or on a device) to the state of the error flag that is handled by the corresponding error handler.

To construct an object of this class call the method error_handler<ErrorEnumT>::get_access().

Template Parameters:
  • ErrorEnumT – the type of the error enumeration which items are used as errors by this error flag accessor

  • AccessMode – the access mode (sycl::access_mode) that is used to access the error flag

  • IsHost – the flag that specifies whether this error flag accessor is host (true), or not (false)

Public Types

using error_enum_t = ErrorEnumT#

Alias for the template parameter ErrorEnumT (the type of the error enumeration which items are used as errors by this error flag accessor).

Public Functions

auto get_error() const -> ErrorEnumT#

Returns the current value of the error flag.

Returns:

the current value of the error flag

template<sycl::access_mode AccessModeCopy = access_mode_v>
void set_error(ErrorEnumT error_enum) const#

Sets the given value error_enum to the error flag.

This function is available only unless AccessMode is read-only.

Parameters:

error_enum[in] the given value to be set to the error flag

Public Static Attributes

static constexpr auto access_mode_v = AccessMode#

Alias for the template parameter AccessMode (the access mode that is used to access the error flag).

Friends

friend class error_handler