|
rexlib 0.1.0
Device-agnostic array computing library for CryoEM and CryoET image processing, with a pluggable backend architecture
|
Description of the static characteristics of a physical device visible from the host. More...
#include <rexlib/core/hardware/device_properties.hpp>
Public Member Functions | |
| device_properties (const device_properties &other) | |
| device_properties (device_properties &&other) noexcept | |
| device_properties & | operator= (const device_properties &other) |
| device_properties & | operator= (device_properties &&other) noexcept |
| void | set_type (device_type type) |
| Set the device type. | |
| device_type | get_type () const noexcept |
| Get the device type. | |
| void | set_name (const std::string &name) |
| Set the device name. | |
| const std::string & | get_name () const noexcept |
| Get the device name. | |
| void | set_physical_location (const std::string &location) |
| Set the physical location of the device. | |
| const std::string & | get_physical_location () const noexcept |
| Get the physical location of the device. | |
| void | set_total_memory_bytes (std::size_t bytes) |
| Set the total memory of the device in bytes. | |
| std::size_t | get_total_memory_bytes () const noexcept |
| Get the total memory of the device in bytes. | |
| void | set_optimal_data_alignment (std::size_t alignment) |
| Set the optimal data alignment. | |
| std::size_t | get_optimal_data_alignment () const noexcept |
| Get the optimal data alignment. | |
Description of the static characteristics of a physical device visible from the host.
device_properties is a value-type container populated by a device_backend (typically via device_backend::get_device_properties) and consumed by callers that need to inspect a device without instantiating it. Instances are copyable and movable and use the pimpl idiom, so the binary representation is owned by the implementation and unrelated to the size of this class.
|
noexcept |
Get the device name.
|
noexcept |
Get the optimal data alignment.
|
noexcept |
Get the physical location of the device.
Usually this is a PCI address; see set_physical_location for the format conventions.
|
noexcept |
Get the total memory of the device in bytes.
|
noexcept |
Get the device type.
Set the device name.
The name is meant to be a human-readable identifier suitable for display (e.g. the model reported by the vendor driver) and is not required to be unique.
| [in] | name | The device name. |
| void rexlib::device_properties::set_optimal_data_alignment | ( | std::size_t | alignment | ) |
Set the optimal data alignment.
Buffers aligned to this boundary typically yield the best throughput on this device (e.g. SIMD width on CPUs, coalesced access boundary on GPUs). The value should be a power of two.
| [in] | alignment | The optimal data alignment in bytes. |
Set the physical location of the device.
Usually this is a PCI address but the format is backend defined and intended only for diagnostics and matching against external tooling.
| [in] | location | The physical location of the device. |
| void rexlib::device_properties::set_total_memory_bytes | ( | std::size_t | bytes | ) |
Set the total memory of the device in bytes.
This is the total amount of memory that the device exposes to the framework, not the currently free amount, and represents an upper bound for how much can ever be allocated on it.
| [in] | bytes | Number of bytes. |
| void rexlib::device_properties::set_type | ( | device_type | type | ) |
Set the device type.
Classifies the device into one of the broad categories defined by device_type (CPU, discrete GPU, integrated GPU, etc.). Used by higher-level dispatch logic to pick reasonable defaults without knowing the specific backend.
| [in] | type | The device type. |