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

#include <opencl_device.h>

Inheritance diagram for OpenCL::Device:

Public Types

enum  Type { Type::CPU, Type::GPU, Type::Accelerator, Default }
 

Public Member Functions

 Device (cl_device_id id, QObject *parent=nullptr)
 
cl_device_id id () const
 
bool isAvailable () const
 
bool hasCompiler () const
 
const QStringList & extensions () const
 
qint64 globalMemorySize () const
 
qint64 localMemorySize () const
 
int computeUnitSize () const
 
int clockFrequency () const
 
QString name () const
 
OpenCL::Device::Type type () const
 
cl_platform_id platform () const
 

Detailed Description

This provides information about a single OpenCL device. This class is not intended to be instantiated on its own but instead queried through the platform class. Any pointer to a device the platform methods return will exist for the life time of the ACE program. This class also provides its underlying OpenCL device ID that is used by other OpenCL classes.

Member Enumeration Documentation

◆ Type

enum OpenCL::Device::Type
strong

Defines the different OpenCL device types a device can be.

Enumerator
CPU 

Defines the CPU device type.

Defines the GPU device type.

GPU 

Defines the accelerator device type.

Accelerator 

Defines the default device type.

Constructor & Destructor Documentation

◆ Device()

Device::Device ( cl_device_id  id,
QObject *  parent = nullptr 
)
explicit

Constructs a new OpenCL device object with the given OpenCL device ID and optional parent.

Parameters
idOpenCL device ID used to construct this new device object.
parentOptional parent for this new object.

Member Function Documentation

◆ clockFrequency()

int Device::clockFrequency ( ) const

Returns the maximum clock frequency for this device's hardware in megahertz. Usually in all modern GPU devices it can run at many different clock speeds.

Returns
Maximum clock frequency for this device's hardware in megahertz.

◆ computeUnitSize()

int Device::computeUnitSize ( ) const

Returns the total number of compute units for this device's underlying hardware. In other words how many compute units can operate at any one time in parallel.

Returns
Total number of compute units for this device's hardware.

◆ extensions()

const QStringList & Device::extensions ( ) const

Returns the OpenCL extensions supported by this device.

Returns
OpenCL extensions supported by this device.

◆ globalMemorySize()

qint64 Device::globalMemorySize ( ) const

Returns the global memory size of this device in bytes.

Returns
Global memory size of this device in bytes.

◆ hasCompiler()

bool Device::hasCompiler ( ) const

Indicates if this device has the ability to compile OpenCL kernel code.

Returns
True if this device can compile kernel code or false otherwise.

◆ id()

cl_device_id Device::id ( ) const

Returns the OpenCL device ID for this device object.

Returns
OpenCL device ID for this object.

◆ isAvailable()

bool Device::isAvailable ( ) const

Indicates if this device object is available for use with OpenCL.

Returns
True if this device is available or false otherwise.

◆ localMemorySize()

qint64 Device::localMemorySize ( ) const

Returns the local memory size of this device in bytes.

Returns
Local memory size of this device in bytes.

◆ name()

QString Device::name ( ) const

Returns the name of this device.

Returns
Name of this device.

◆ platform()

cl_platform_id Device::platform ( ) const

Returns the OpenCL platform ID that this device belongs to.

Returns
OpenCL platform ID of this device.

◆ type()

OpenCL::Device::Type Device::type ( ) const

Returns the OpenCL device type of this device.

Returns
OpenCL device type of this device.

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