cl::sycl::default_selector Class Reference
Implementation of a device_selector that selects either a CPU or a GPU, and falls back to a host mode device if none can be found. More...
#include <device_selector.h>
Public Member Functions | |
default_selector () | |
Constructs a default_selector. More... | |
int | operator() (const device &Device) const override |
Overload that scores both CPUs and GPUs positive if they have SPIR support, GPUs are scored higher, scores host mode devices as positive but lower than a non-host device. More... | |
Public Member Functions inherited from cl::sycl::device_selector | |
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... | |
Protected Member Functions | |
default_selector (const char *target) | |
Constructs a default_selector. More... | |
default_selector (string_class targetDevice) | |
Constructs a default_selector. More... | |
void | set_offline_backend (detail::offline_backend m) |
This function sets explicitly the m_compilationInfo member and it's used as a helper for unit testing. More... | |
detail::offline_backend | get_offline_backend () const noexcept |
Get the cached offline compilation query result. More... | |
Protected Member Functions inherited from cl::sycl::device_selector | |
device | evaluate_devices () const |
Evaluates devices and returns the most suitable one. More... | |
Additional Inherited Members | |
Protected Attributes inherited from cl::sycl::device_selector | |
unique_ptr_class< detail::device_selector > | m_impl |
Detailed Description
Implementation of a device_selector that selects either a CPU or a GPU, and falls back to a host mode device if none can be found.
Definition at line 82 of file device_selector.h.
Constructor & Destructor Documentation
◆ default_selector() [1/3]
|
explicitprotected |
Constructs a default_selector.
- Parameters
-
targetDevice String representing a device target
◆ default_selector() [2/3]
|
inlineexplicitprotected |
Constructs a default_selector.
- Parameters
-
targetDevice String representing a device target
Definition at line 92 of file device_selector.h.
◆ default_selector() [3/3]
|
inline |
Constructs a default_selector.
Definition at line 98 of file device_selector.h.
Member Function Documentation
◆ get_offline_backend()
|
inlineprotectednoexcept |
Get the cached offline compilation query result.
Definition at line 116 of file device_selector.h.
◆ operator()()
|
overridevirtual |
Overload that scores both CPUs and GPUs positive if they have SPIR support, GPUs are scored higher, scores host mode devices as positive but lower than a non-host device.
This should never fail.
- Parameters
-
device The device that is to be scored.
- Returns
- an integer representing the allocated score for the device.
Implements cl::sycl::device_selector.
◆ set_offline_backend()
|
inlineprotected |
This function sets explicitly the m_compilationInfo member and it's used as a helper for unit testing.
Definition at line 112 of file device_selector.h.
The documentation for this class was generated from the following file: