Accelerated Computation Engine
Public Member Functions | List of all members
OpenCL::Context Class Reference

#include <opencl_context.h>

Inheritance diagram for OpenCL::Context:

Public Member Functions

 Context (const QList< Device *> &devices, QObject *parent=nullptr)
 
virtual ~Context () override final
 
cl_context id () const
 
const QList< Device * > & devices () const
 

Detailed Description

This contains an OpenCL context. This is a very basic class that simply maintains ownership over an underlying context along with providing basic information about it such as the list of devices associated with it. This class in turn is used by other OpenCL classes that derive from an OpenCL context.

Constructor & Destructor Documentation

◆ Context()

Context::Context ( const QList< Device *> &  devices,
QObject *  parent = nullptr 
)
explicit

Constructs a new OpenCL context with the given list of devices and optional parent. If the given device list is empty or all devices are not part of the same platform then an exception is thrown.

Parameters
devicesList of pointers to devices this context is created from. All devices must be part of the given platform.
parentOptional parent for this new context.

◆ ~Context()

Context::~Context ( )
finaloverridevirtual

Releases the underlying OpenCL context that this object represents.

Member Function Documentation

◆ devices()

const QList< Device * > & Context::devices ( ) const

Returns a read only reference to the list of device pointers which is part of this context.

Returns
Read only reference to list of devices of this context.

◆ id()

cl_context Context::id ( ) const

Returns the OpenCL context ID of this object.

Returns
OpenCL context ID of this object.

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