cl::sycl::platform Class Reference
Interface for abstracting and interacting with an underlying cl_platform_id object. More...
#include <platform.h>
Public Member Functions | |
platform () | |
Default Constructor. More... | |
platform (cl_platform_id platformID) | |
Constructs a platform object using a cl_platform_id object. More... | |
platform (const platform &rhs)=default | |
Copy Constructor. More... | |
platform (const cl::sycl::device_selector &deviceSelector) | |
Constructs a platform from an existing device selector. More... | |
platform & | operator= (const platform &rhs)=default |
Assignment Operator. More... | |
~platform ()=default | |
Destroys the implementation object. More... | |
cl_platform_id | get () const |
Returns the underlying cl_platform_id object. More... | |
cl_platform_id | get_no_retain () const noexcept |
Returns the underlying cl_platform_id object without checking if the system is host or device. More... | |
bool | is_host () const |
Specifies whether the platform is a host platform. More... | |
template<info::platform param> | |
info::param_traits< info::platform, param >::return_type | get_info () const |
Get OpenCL information for the underlying cl_platform_id. More... | |
bool | has_extension (const char *extension) const |
This function avoids using strings across the ABI. More... | |
bool | has_extension (const string_class &extension) const |
Check whether a specific extension is supported on the platform. More... | |
vector_class< device > | get_devices (info::device_type deviceType=info::device_type::all) const |
Get a list of devices associated with the platform. More... | |
dplatform_shptr | get_impl () const |
Static Public Member Functions | |
static vector_class< platform > | get_platforms () |
Get a list of all available platforms. More... | |
Protected Member Functions | |
platform (detail::impl_constructor_tag, const detail::device_selector_wrapper &deviceSelector) | |
Constructs a SYCL platform object using a custom device selector callable. More... | |
bool | has_impl (aspect_impl asp) const |
Returns true if all of the devices associated with the platform support the specified aspect. More... | |
Protected Attributes | |
dplatform_shptr | m_impl |
Implementation object. More... | |
Friends | |
bool | operator== (const platform &lhs, const platform &rhs) |
Checks for equality with another platform instance. More... | |
bool | operator!= (const platform &lhs, const platform &rhs) |
Detailed Description
Interface for abstracting and interacting with an underlying cl_platform_id object.
Definition at line 104 of file platform.h.
Constructor & Destructor Documentation
◆ platform() [1/5]
cl::sycl::platform::platform | ( | ) |
Default Constructor.
Constructs a platform object containing the device returned by default_selector_v in SYCL 2020. Otherwise, constructs a host platform.
◆ platform() [2/5]
|
explicit |
Constructs a platform object using a cl_platform_id object.
- Parameters
-
platformID The cl_platform_id object constructed using the OpenCL API.
◆ platform() [3/5]
|
default |
Copy Constructor.
Constructs a platform object from another platform object.
- Parameters
-
rhs The platform object to copy
◆ platform() [4/5]
|
explicit |
Constructs a platform from an existing device selector.
- Parameters
-
deviceSelector User device selector
◆ platform() [5/5]
|
explicitprotected |
Constructs a SYCL platform object using a custom device selector callable.
- Parameters
-
deviceSelector Callable that can evaluate devices
◆ ~platform()
|
default |
Destroys the implementation object.
Member Function Documentation
◆ get()
cl_platform_id cl::sycl::platform::get | ( | ) | const |
Returns the underlying cl_platform_id object.
- Returns
- The cl_platform_id object usable by the OpenCL API.
◆ get_devices()
vector_class<device> cl::sycl::platform::get_devices | ( | info::device_type | deviceType = info::device_type::all | ) | const |
Get a list of devices associated with the platform.
- Parameters
-
deviceType The type of devices to search for, set to info::device_type::all by default
- Returns
- A vector of device objects.
◆ get_impl()
dplatform_shptr cl::sycl::platform::get_impl | ( | ) | const |
◆ get_info()
|
inline |
Get OpenCL information for the underlying cl_platform_id.
- Template Parameters
-
param The info::platform descriptor parameter.
- Returns
- The retrieved information as the appropriate return type, derived via the param_traits struct, defined in param_traits.h.
Definition at line 212 of file platform.h.
◆ get_no_retain()
|
noexcept |
Returns the underlying cl_platform_id object without checking if the system is host or device.
- Returns
- The cl_platform_id object usable by the OpenCL API.
◆ get_platforms()
|
static |
Get a list of all available platforms.
- Returns
- A vector of platform objects. The returned vector will always contain a host platform.
◆ has_extension() [1/2]
bool cl::sycl::platform::has_extension | ( | const char * | extension | ) | const |
This function avoids using strings across the ABI.
◆ has_extension() [2/2]
|
inline |
Check whether a specific extension is supported on the platform.
- Parameters
-
extension A string specifying the extension to check for.
- Returns
- A boolean specifying whether the extension is supported by the platform.
Definition at line 237 of file platform.h.
◆ has_impl()
|
protected |
Returns true if all of the devices associated with the platform support the specified aspect.
The aspect to be queried for.
◆ is_host()
bool cl::sycl::platform::is_host | ( | ) | const |
Specifies whether the platform is a host platform.
- Returns
- True if the platform is a host platform.
◆ operator=()
Assignment Operator.
Completely assigns the contents of the platform to that of another.
- Parameters
-
rhs The platform object to copy
Friends And Related Function Documentation
◆ operator!=
Definition at line 177 of file platform.h.
◆ operator==
Checks for equality with another platform instance.
- Returns
- Boolean specifying whether the provided platform if this platform is equal to the the provided platform.
Definition at line 173 of file platform.h.
Member Data Documentation
◆ m_impl
|
protected |
Implementation object.
Definition at line 292 of file platform.h.
The documentation for this class was generated from the following file: