cl::sycl::device Class Reference
Interface for abstracting and interacting with an underlying cl_device_id object. More...
#include <device.h>
Public Member Functions | |
device () | |
Default Constructor. More... | |
device (cl_device_id deviceID) | |
Constructs a device object using a cl_device_id object and retains the cl_device_id object if the device is not in host mode. More... | |
device (const device_selector &deviceSelector) | |
Constructs a device using the requested device selector. More... | |
device (const device &rhs)=default | |
Constructs a device object from another device object and retains the cl_device_id object if the device is not in host mode. More... | |
device (device &&rhs)=default | |
Constructs a device object by moving another device object. More... | |
device & | operator= (const device &rhs)=default |
Completely assigns the contents of the device to that of another and retains the cl_device_id object if the device is not in host mode. More... | |
device & | operator= (device &&rhs)=default |
Completely moves the contents of the device to that of another. More... | |
COMPUTECPP_TEST_VIRTUAL | ~device ()=default |
Destroys the implementation object. More... | |
COMPUTECPP_TEST_VIRTUAL cl_device_id | get () const |
Returns the underlying cl_device_id object and retain it. More... | |
COMPUTECPP_TEST_VIRTUAL bool | is_host () const |
Specifies whether the device is in host mode. More... | |
COMPUTECPP_TEST_VIRTUAL bool | is_cpu () const |
Specifies whether the device is in CPU mode. More... | |
COMPUTECPP_TEST_VIRTUAL bool | is_gpu () const |
COMPUTECPP_TEST_VIRTUAL bool | is_accelerator () const |
template<info::device param> | |
info::param_traits< info::device, param >::return_type | get_info () const |
Gets OpenCL information for the underlying cl_device_id. More... | |
COMPUTECPP_TEST_VIRTUAL bool | has_extension (const char *extension) const |
This function avoids using strings across the ABI. More... | |
bool | has_extension (string_class extension) const |
Specifies whether a specific extension is supported on the device. More... | |
COMPUTECPP_TEST_VIRTUAL platform | get_platform () const |
Gets the platform that the device is associated with. More... | |
COMPUTECPP_TEST_VIRTUAL ddevice_shptr | get_impl () const |
Returns an opaque pointer to the implementation object. More... | |
device (const ddevice_shptr &impl) | |
Constructs a device using an existing implementation object. More... | |
template<info::partition_property prop> | |
vector_class< device > | create_sub_devices (size_t nbSubDev) const |
Partition device into sub devices evenly. More... | |
template<info::partition_property prop> | |
vector_class< device > | create_sub_devices (const vector_class< size_t > &counts) const |
Partition device into sub devices by explicitly stating the number of compute units used by each device. More... | |
template<info::partition_property prop> | |
vector_class< device > | create_sub_devices (info::partition_affinity_domain affinityDomain) const |
Partition device into sub devices using the provided affinity domain. More... | |
Static Public Member Functions | |
static vector_class< device > | get_devices (info::device_type deviceType=info::device_type::all) |
Gets a list of all available devices. More... | |
Public Attributes | |
friend | info_convert< cl_device_id *, device > |
Protected Member Functions | |
device (detail::impl_constructor_tag, const detail::device_selector_wrapper &deviceSelector) | |
Constructs a SYCL device object using a custom device selector callable. More... | |
Friends | |
bool | operator== (const device &lhs, const device &rhs) |
Determines if lhs and rhs are equal. More... | |
bool | operator!= (const device &lhs, const device &rhs) |
Determines if lhs and rhs are not equal. More... | |
Detailed Description
Interface for abstracting and interacting with an underlying cl_device_id object.
Constructor & Destructor Documentation
◆ device() [1/7]
cl::sycl::device::device | ( | ) |
Default Constructor.
Constructs a device object using selector default_selector if we are in SYCL 2020. Otherwise, constructs a host device.
◆ device() [2/7]
|
explicit |
Constructs a device object using a cl_device_id object and retains the cl_device_id object if the device is not in host mode.
- Parameters
-
deviceID A cl_device_id object.
◆ device() [3/7]
|
explicit |
Constructs a device using the requested device selector.
- Parameters
-
deviceSelector the device selector that will provide a device to copy
◆ device() [4/7]
|
explicitprotected |
Constructs a SYCL device object using a custom device selector callable.
- Parameters
-
deviceSelector Callable that can evaluate devices
◆ device() [5/7]
|
default |
Constructs a device object from another device object and retains the cl_device_id object if the device is not in host mode.
◆ device() [6/7]
|
default |
Constructs a device object by moving another device object.
◆ ~device()
|
default |
Destroys the implementation object.
◆ device() [7/7]
|
explicit |
Constructs a device using an existing implementation object.
Member Function Documentation
◆ create_sub_devices() [1/3]
vector_class<device> cl::sycl::device::create_sub_devices | ( | size_t | nbSubDev | ) | const |
Partition device into sub devices evenly.
- Template Parameters
-
prop Must be info::partition_property::partition_equally.
- Parameters
-
nbSubDev Desired number of sub devices.
- Returns
- Vector of sub devices.
◆ create_sub_devices() [2/3]
vector_class<device> cl::sycl::device::create_sub_devices | ( | const vector_class< size_t > & | counts | ) | const |
Partition device into sub devices by explicitly stating the number of compute units used by each device.
- Template Parameters
-
prop Must be info::partition_property::partition_by_counts.
- Parameters
-
counts A vector of sizes for the resulting sub devices.
- Returns
- Vector of sub devices. The number of sub devices created is the same as the number of sizes passed.
◆ create_sub_devices() [3/3]
vector_class<device> cl::sycl::device::create_sub_devices | ( | info::partition_affinity_domain | affinityDomain | ) | const |
Partition device into sub devices using the provided affinity domain.
- Template Parameters
-
prop Must be info::partition_property::partition_by_affinity_domain.
- Parameters
-
affinityDomain Affinity domain used for the partitioning.
- Returns
- Vector of sub devices.
◆ get()
COMPUTECPP_TEST_VIRTUAL cl_device_id cl::sycl::device::get | ( | ) | const |
Returns the underlying cl_device_id object and retain it.
The caller is responsible for releasing the returned cl_device_id.
- Returns
- The cl_device_id object.
◆ get_devices()
|
static |
Gets a list of all available devices.
- Returns
- A vector of device objects.
◆ get_impl()
COMPUTECPP_TEST_VIRTUAL ddevice_shptr cl::sycl::device::get_impl | ( | ) | const |
Returns an opaque pointer to the implementation object.
- Returns
- A pointer to the implementation object.
◆ get_info()
|
inline |
◆ get_platform()
COMPUTECPP_TEST_VIRTUAL platform cl::sycl::device::get_platform | ( | ) | const |
Gets the platform that the device is associated with.
- Returns
- A platform object.
◆ has_extension() [1/2]
COMPUTECPP_TEST_VIRTUAL bool cl::sycl::device::has_extension | ( | const char * | extension | ) | const |
This function avoids using strings across the ABI.
◆ has_extension() [2/2]
|
inline |
◆ is_accelerator()
COMPUTECPP_TEST_VIRTUAL bool cl::sycl::device::is_accelerator | ( | ) | const |
- Returns
- A boolean specifying whether the device is an OpenCL Accelerator device.
◆ is_cpu()
COMPUTECPP_TEST_VIRTUAL bool cl::sycl::device::is_cpu | ( | ) | const |
Specifies whether the device is in CPU mode.
- Returns
- A boolean specifying whether the device is an OpenCL CPU device.
◆ is_gpu()
COMPUTECPP_TEST_VIRTUAL bool cl::sycl::device::is_gpu | ( | ) | const |
- Returns
- A boolean specifying whether the device is an OpenCL GPU device.
◆ is_host()
COMPUTECPP_TEST_VIRTUAL bool cl::sycl::device::is_host | ( | ) | const |
Specifies whether the device is in host mode.
- Returns
- A boolean specifying whether the device is in host mode.
◆ operator=() [1/2]
Completely assigns the contents of the device to that of another and retains the cl_device_id object if the device is not in host mode.
◆ operator=() [2/2]
Completely moves the contents of the device to that of another.
Friends And Related Function Documentation
◆ operator!=
◆ operator==
Member Data Documentation
◆ info_convert< cl_device_id *, device >
friend cl::sycl::device::info_convert< cl_device_id *, device > |
The documentation for this class was generated from the following file: