rexlib 0.1.0
Device-agnostic array computing library for CryoEM and CryoET image processing, with a pluggable backend architecture
Loading...
Searching...
No Matches
device_properties.hpp
1// SPDX-License-Identifier: GPL-3.0-only
2
3#pragma once
4
5#include "device_type.hpp"
6#include "../platform/dynamic_shared_object.h"
7
8#include <memory>
9#include <string>
10
11namespace rexlib
12{
13
27{
28public:
29 REXLIB_API
30 device_properties() noexcept;
31 REXLIB_API
33 REXLIB_API
34 device_properties(device_properties&& other) noexcept;
35 REXLIB_API
37
38 REXLIB_API
39 device_properties& operator=(const device_properties& other);
40 REXLIB_API
41 device_properties& operator=(device_properties&& other) noexcept;
42
53 REXLIB_API
55
62 REXLIB_API
63 device_type get_type() const noexcept;
64
74 REXLIB_API
75 void set_name(const std::string &name);
76
84 REXLIB_API
85 const std::string& get_name() const noexcept;
86
96 REXLIB_API
97 void set_physical_location(const std::string &location);
98
109 REXLIB_API
110 const std::string& get_physical_location() const noexcept;
111
121 REXLIB_API
122 void set_total_memory_bytes(std::size_t bytes);
123
130 REXLIB_API
131 std::size_t get_total_memory_bytes() const noexcept;
132
142 REXLIB_API
143 void set_optimal_data_alignment(std::size_t alignment);
144
151 REXLIB_API
152 std::size_t get_optimal_data_alignment() const noexcept;
153
154private:
155 class implementation;
156 std::unique_ptr<implementation> m_implementation;
157
158 implementation& create_implementation_if_null();
159 const implementation& get_implementation() const noexcept;
160};
161
162} // namespace rexlib
Description of the static characteristics of a physical device visible from the host.
Definition device_properties.hpp:27
const std::string & get_name() const noexcept
Get the device name.
std::size_t get_optimal_data_alignment() const noexcept
Get the optimal data alignment.
device_type get_type() const noexcept
Get the device type.
void set_type(device_type type)
Set the device type.
std::size_t get_total_memory_bytes() const noexcept
Get the total memory of the device in bytes.
void set_total_memory_bytes(std::size_t bytes)
Set the total memory of the device in bytes.
void set_physical_location(const std::string &location)
Set the physical location of the device.
void set_optimal_data_alignment(std::size_t alignment)
Set the optimal data alignment.
void set_name(const std::string &name)
Set the device name.
const std::string & get_physical_location() const noexcept
Get the physical location of the device.
Arrays, the operations on them and the devices that run those operations.
Definition cpu_device.hpp:10
device_type
Broad classification of compute devices.
Definition device_type.hpp:14