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_backend.hpp
1// SPDX-License-Identifier: GPL-3.0-only
2
3#pragma once
4
5#include "device_properties.hpp"
6#include "../version.hpp"
7#include "../platform/dynamic_shared_object.h"
8
9#include <memory>
10#include <string>
11#include <vector>
12
13namespace rexlib
14{
15
16class device;
17
33class REXLIB_API device_backend
34{
35public:
36 device_backend() noexcept;
37 device_backend(const device_backend &other) = delete;
38 device_backend(device_backend &&other) = delete;
39 virtual ~device_backend();
40
41 device_backend& operator=(const device_backend &other) = delete;
42 device_backend& operator=(device_backend &&other) = delete;
43
49 virtual std::string get_name() const = 0;
50
56 virtual version get_version() const = 0;
57
74 virtual void enumerate_devices(std::vector<std::size_t> &ids) const = 0;
75
93 std::size_t id,
95 ) const = 0;
96
112 virtual std::shared_ptr<device> create_device(std::size_t id) const = 0;
113};
114
115} // namespace rexlib
Abstract class that represents a hardware backend.
Definition device_backend.hpp:34
virtual void enumerate_devices(std::vector< std::size_t > &ids) const =0
Enumerate available devices for this backend.
virtual std::shared_ptr< device > create_device(std::size_t id) const =0
Create a device handle for the given device identifier.
virtual bool get_device_properties(std::size_t id, device_properties &desc) const =0
Query the static properties of a device.
virtual std::string get_name() const =0
Get the name of the backend.
virtual version get_version() const =0
Get the version of the backend.
Description of the static characteristics of a physical device visible from the host.
Definition device_properties.hpp:27
Definition version.hpp:15
Arrays, the operations on them and the devices that run those operations.
Definition cpu_device.hpp:10
@ device
The memory resource can be optimally accessed by the device.