OpenCL C++ Bindings

Loading...
Searching...
No Matches
cl::Platform Class Reference

Class interface for cl_platform_id. More...

`#include <opencl.hpp>`

Inheritance diagram for cl::Platform:

## Public Member Functions
| Platform ()
| Default constructor - initializes to nullptr.
| Platform (const cl_platform_id &platform, bool retainObject=false)
| Constructor from cl_platform_id.
Platform & | operator= (const cl_platform_id &rhs)
| Assignment operator from cl_platform_id.
template<typename T>
cl_int | getInfo (cl_platform_info name, T *param) const
| Wrapper for clGetPlatformInfo().
template<cl_platform_info name>
detail::param_traits< detail::cl_platform_info, name >::param_type | getInfo (cl_int *err=nullptr) const
| Wrapper for clGetPlatformInfo() that returns by value.
cl_int | getDevices (cl_device_type type, vector< Device > *devices) const
| Gets a list of devices for this platform.
cl_int | unloadCompiler ()
| Wrapper for clUnloadCompiler().
Public Member Functions inherited from cl::detail::Wrapper< cl_platform_id >
Wrapper< cl_type > & | operator= (const Wrapper< cl_type > &rhs)
const cl_type & | operator() () const
cl_type | get () const

## Static Public Member Functions
static Platform | getDefault (cl_int *errResult=nullptr)
static Platform | setDefault (const Platform &default_platform)
static cl_int | get (vector< Platform > *platforms)
| Gets a list of available platforms.
static cl_int | get (Platform *platform)
| Gets the first available platform.
static Platform | get (cl_int *errResult=nullptr)
| Gets the first available platform, returning it by value.

## Additional Inherited Members
Public Types inherited from cl::detail::Wrapper< cl_platform_id >
typedef cl_platform_id | cl_type
Protected Member Functions inherited from cl::detail::Wrapper< cl_platform_id >
cl_int | retain () const
cl_int | release () const
Protected Attributes inherited from cl::detail::Wrapper< cl_platform_id >
cl_type | object_

## Detailed Description

Class interface for cl_platform_id.

Note
  Copies of these objects are inexpensive, since they don't 'own' any underlying resources or data structures.

See also
  cl_platform_id

Definition at line 2717 of file opencl.hpp.

## Constructor & Destructor Documentation

## ◆ Platform() [1/2]

cl::Platform::Platform | ( |  | ) |
| inline

Default constructor - initializes to nullptr.

Definition at line 2790 of file opencl.hpp.

## ◆ Platform() [2/2]

cl::Platform::Platform | ( | const cl_platform_id & | platform,
|  | bool | retainObject = false )
| inline explicit

Constructor from cl_platform_id.

Parameters

  retainObject | will cause the constructor to retain its cl object. Defaults to false to maintain compatibility with earlier versions. This simply copies the platform ID value, which is an inexpensive operation.

Definition at line 2799 of file opencl.hpp.

## Member Function Documentation

## ◆ get() [1/3]

Platform cl::Platform::get | ( | cl_int * | errResult = nullptr | ) |
| inline static

Gets the first available platform, returning it by value.

Returns
  Returns a valid platform if one is available. If no platform is available will return a null platform. Throws an exception if no platforms are available or an error condition occurs. Wraps clGetPlatformIDs(), returning the first result.

Definition at line 3053 of file opencl.hpp.

## ◆ get() [2/3]

cl_int cl::Platform::get | ( | Platform * | platform | ) |
| inline static

Gets the first available platform.

Wraps clGetPlatformIDs(), returning the first result.

Definition at line 3034 of file opencl.hpp.

## ◆ get() [3/3]

cl_int cl::Platform::get | ( | vector< Platform > * | platforms | ) |
| inline static

Gets a list of available platforms.

Wraps clGetPlatformIDs().

Definition at line 2999 of file opencl.hpp.

## ◆ getDefault()

Platform cl::Platform::getDefault | ( | cl_int * | errResult = nullptr | ) |
| inline static

Definition at line 2812 of file opencl.hpp.

## ◆ getDevices()

cl_int cl::Platform::getDevices | ( | cl_device_type | type,
|  | vector< Device > * | devices ) const
| inline

Gets a list of devices for this platform.

Wraps clGetDeviceIDs().

Definition at line 2864 of file opencl.hpp.

## ◆ getInfo() [1/2]

template<cl_platform_info name>

detail::param_traits< detail::cl_platform_info, name >::param_type cl::Platform::getInfo | ( | cl_int * | err = nullptr | ) | const
| inline

Wrapper for clGetPlatformInfo() that returns by value.

Definition at line 2849 of file opencl.hpp.

## ◆ getInfo() [2/2]

template<typename T>

cl_int cl::Platform::getInfo | ( | cl_platform_info | name,
|  | T * | param ) const
| inline

Wrapper for clGetPlatformInfo().

Definition at line 2839 of file opencl.hpp.

## ◆ operator=()

Platform & cl::Platform::operator= | ( | const cl_platform_id & | rhs | ) |
| inline

Assignment operator from cl_platform_id.

This simply copies the platform ID value, which is an inexpensive operation.

Definition at line 2806 of file opencl.hpp.

## ◆ setDefault()

Platform cl::Platform::setDefault | ( | const Platform & | default_platform | ) |
| inline static

Modify the default platform to be used by subsequent operations. Will only set the default if no default was previously created.

Returns
  updated default platform. Should be compared to the passed value to ensure that it was updated.

Definition at line 2830 of file opencl.hpp.

## ◆ unloadCompiler()

cl_int cl::Platform::unloadCompiler | ( |  | ) |
| inline

Wrapper for clUnloadCompiler().

Definition at line 3067 of file opencl.hpp.

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

- opencl.hpp