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

RAII wrapper class around a cl_context. More...

#include <context.hpp>

Public Member Functions

 context ()=default
 Empty default construct context.
 
 context (cl_context device_context, cl_platform_id platform, std::vector< cl_device_id > devices)
 Construct a new OpenCL context. More...
 
 context (const context &)=delete
 Delete copy-constructor to make context a move only type.
 
 context (context &&other) noexcept
 Move-constructor as context is a move-only type. More...
 
contextoperator= (const context &)=delete
 Delete copy-assignment-operator to make context a move only type.
 
contextoperator= (context &&other)
 Move-assignment-operator as context is a move-only type. More...
 
 ~context ()
 Release the context resources on destruction.
 
 operator cl_context & () noexcept
 Implicitly convert a context wrapper to an OpenCL cl_context. More...
 
 operator const cl_context & () const noexcept
 Implicitly convert a context wrapper to an OpenCL cl_context. More...
 

Public Attributes

cl_context device_context {}
 The OpenCL context associated with the platform containing the respective devices.
 
cl_platform_id platform {}
 The OpenCL platform associated with this context.
 
std::vector< cl_device_id > devices {}
 All devices associated with this context.
 

Detailed Description

RAII wrapper class around a cl_context.

Also contains the associated platform and a list of all associated devices.

Constructor & Destructor Documentation

◆ context() [1/2]

plssvm::opencl::detail::context::context ( cl_context  device_context,
cl_platform_id  platform,
std::vector< cl_device_id >  devices 
)

Construct a new OpenCL context.

Parameters
[in]device_contextthe associated OpenCL context
[in]platformthe OpenCL platform associated with this OpenCL context
[in]devicesthe list of devices associated with this OpenCL cl_context

◆ context() [2/2]

plssvm::opencl::detail::context::context ( context &&  other)
noexcept

Move-constructor as context is a move-only type.

Parameters
[in,out]otherthe context to move the resources from

Member Function Documentation

◆ operator=()

context& plssvm::opencl::detail::context::operator= ( context &&  other)

Move-assignment-operator as context is a move-only type.

Parameters
[in,out]otherthe context to move the resources from
Returns
*this

◆ operator cl_context &()

plssvm::opencl::detail::context::operator cl_context & ( )
inlinenoexcept

Implicitly convert a context wrapper to an OpenCL cl_context.

Returns
the wrapped OpenCL cl_context ([[nodiscard]])

◆ operator const cl_context &()

plssvm::opencl::detail::context::operator const cl_context & ( ) const
inlinenoexcept

Implicitly convert a context wrapper to an OpenCL cl_context.

Returns
the wrapped OpenCL cl_context ([[nodiscard]])

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