Device Class
A Device
is a processing unit that can execute OpenCL kernels.
It is mainly a GPU, but it can also be a CPU or a simulation of a device (e.g. pocl, oclgrind).
It is a good practice to consider a device as a mini computer with its own memory with which you can communicate through the OpenCL API.
This class holds a set of information allowing the identification of a specific hardware for future communication with it during execution.
The class has no processing functions; it is mainly used to store necessary information required to identify the hardware.
The detection and the communication is managed by Backend
class.
Users should not need to interact with the Device
class extensively, except during the initialization of the library or when using multiple devices for computation.
-
class Device
Device class This class is used to manage devices.
Public Functions
-
virtual auto initialize() -> void = 0
Initialize a device pointer.
-
virtual auto finalize() -> void = 0
Release the device pointer.
-
virtual auto finish() const -> void = 0
Wait for command queue to finish.
-
virtual auto setWaitToFinish(bool flag) -> void = 0
Set flag for waiting for command queue to finish.
-
virtual auto isInitialized() const -> bool = 0
Check if device is initialized.
- Returns:
bool
-
virtual auto getName(bool lowercase = false) const -> std::string = 0
Get device name.
- Returns:
std::string
-
virtual auto getInfo() const -> std::string = 0
Get device info.
- Returns:
std::string
-
virtual auto getInfoExtended() const -> std::string = 0
Get device with more info.
- Returns:
std::string
-
virtual auto getPlatform() const -> std::string = 0
Get device platform.
- Returns:
std::string
-
virtual auto supportImage() const -> bool = 0
check if device is compatible with cl_image
- Returns:
bool
-
virtual auto initialize() -> void = 0