cl::sycl::device_selector Class Reference
Abstract class that can be implemented to tell the runtime how to perform device selection. More...
#include <device_selector.h>
Public Member Functions | |
device_selector () | |
Constructs a device_selector. More... | |
device_selector (const device_selector &rhs) | |
Constructs a device_selector from another device_selector. More... | |
virtual | ~device_selector () |
Empty destructor. More... | |
COMPUTECPP_TEST_VIRTUAL device | select_device () const |
Performs a platform and device selection and returns a pointer to the resulting cl::sycl::device object. More... | |
virtual int | operator() (const device &device) const =0 |
Performs the scoring of a single device, called once for every device discovered. More... | |
Protected Member Functions | |
device | evaluate_devices () const |
Evaluates devices and returns the most suitable one. More... | |
Protected Attributes | |
unique_ptr_class< detail::device_selector > | m_impl |
Detailed Description
Abstract class that can be implemented to tell the runtime how to perform device selection.
The function call operator is a pure virtual function that needs to be implemented within derived classes.
Definition at line 42 of file device_selector.h.
Constructor & Destructor Documentation
◆ device_selector() [1/2]
cl::sycl::device_selector::device_selector | ( | ) |
Constructs a device_selector.
◆ device_selector() [2/2]
cl::sycl::device_selector::device_selector | ( | const device_selector & | rhs | ) |
Constructs a device_selector from another device_selector.
◆ ~device_selector()
|
virtual |
Empty destructor.
Member Function Documentation
◆ evaluate_devices()
|
protected |
Evaluates devices and returns the most suitable one.
- Returns
- chosenDevice The device selected via evaluation.
◆ operator()()
|
pure virtual |
Performs the scoring of a single device, called once for every device discovered.
Needs to be overloaded.
- Parameters
-
device The device that is to be scored.
- Returns
- an integer representing the allocated score for the device.
Implemented in cl::sycl::host_selector, cl::sycl::amd_selector, cl::sycl::intel_selector, cl::sycl::accelerator_selector, cl::sycl::gpu_selector, cl::sycl::cpu_selector, cl::sycl::opencl_selector, and cl::sycl::default_selector.
◆ select_device()
COMPUTECPP_TEST_VIRTUAL device cl::sycl::device_selector::select_device | ( | ) | const |
Performs a platform and device selection and returns a pointer to the resulting cl::sycl::device object.
- Returns
- a pointer to the cl::sycl::device object that is selected.
Member Data Documentation
◆ m_impl
|
protected |
Definition at line 76 of file device_selector.h.
The documentation for this class was generated from the following file: