PLSSVM - Parallel Least Squares Support Vector Machine  2.0.0
A Least Squares Support Vector Machine implementation using different backends.
Public Member Functions | Private Attributes | List of all members
plssvm::opencl::detail::error_code Class Reference

Class wrapping an OpenCL error code. More...

#include <error_code.hpp>

Public Member Functions

 error_code ()=default
 Construct a new error code indicating success (CL_SUCCESS).
 
 error_code (cl_int error) noexcept
 Construct a new error code wrapping the OpenCL error code. More...
 
error_codeoperator= (cl_int error) noexcept
 Assign the OpenCL error code to *this. More...
 
void assign (cl_int error) noexcept
 Assign the OpenCL error code to *this. More...
 
void clear () noexcept
 Sets to error code value back to CL_SUCCESS.
 
cl_int value () const noexcept
 Obtain the value of the error code. More...
 
std::string_view message () const noexcept
 Obtains the explanatory string of the error code. More...
 
 operator bool () const noexcept
 Checks whether the error code indicates success or not. More...
 
cl_int * operator& () noexcept
 Overloads the addressof operator to be able to set the wrapped error code value using an out-parameter in calls to OpenCL functions. More...
 

Private Attributes

cl_int err_ { CL_SUCCESS }
 The wrapped OpenCL error code.
 

Detailed Description

Class wrapping an OpenCL error code.

Inspired by std::error_code.

Constructor & Destructor Documentation

◆ error_code()

plssvm::opencl::detail::error_code::error_code ( cl_int  error)
noexcept

Construct a new error code wrapping the OpenCL error code.

Parameters
[in]errorthe OpenCL error code

Member Function Documentation

◆ operator=()

error_code& plssvm::opencl::detail::error_code::operator= ( cl_int  error)
noexcept

Assign the OpenCL error code to *this.

Parameters
[in]errorthe OpenCL error code
Returns
*this

◆ assign()

void plssvm::opencl::detail::error_code::assign ( cl_int  error)
noexcept

Assign the OpenCL error code to *this.

Parameters
[in]errorthe OpenCL error code

◆ value()

cl_int plssvm::opencl::detail::error_code::value ( ) const
noexcept

Obtain the value of the error code.

Returns
the error code value ([[nodiscard]])

◆ message()

std::string_view plssvm::opencl::detail::error_code::message ( ) const
noexcept

Obtains the explanatory string of the error code.

Returns
the string representation of the error code ([[nodiscard]])

◆ operator bool()

plssvm::opencl::detail::error_code::operator bool ( ) const
explicitnoexcept

Checks whether the error code indicates success or not.

Returns
true if the error code is CL_SUCCESS, otherwise false ([[nodiscard]])

◆ operator&()

cl_int* plssvm::opencl::detail::error_code::operator& ( )
noexcept

Overloads the addressof operator to be able to set the wrapped error code value using an out-parameter in calls to OpenCL functions.

Returns
pointer to the wrapped OpenCL error code ([[nodiscard]])

The documentation for this class was generated from the following file: