Kaspersky Neuromorphic Platform  1.0.0
API Reference
Loading...
Searching...
No Matches
device.h
Go to the documentation of this file.
1
22#pragma once
23
24#include <knp/core/core.h>
25
26#include <string>
27
31namespace knp::core
32{
33
37enum class DeviceType
38{
51};
52
53
57class Device
58{
59public:
63 virtual ~Device() = default;
64
65public:
70 [[nodiscard]] const UID &get_uid() const { return base_.uid_; }
71
77 [[nodiscard]] auto &get_tags() { return base_.tags_; }
78
79public:
84 [[nodiscard]] virtual DeviceType get_type() const = 0;
85
90 [[nodiscard]] virtual const std::string &get_name() const = 0;
91
96 [[nodiscard]] virtual float get_power() const = 0;
97
98protected:
102 BaseData base_;
103};
104
105} // namespace knp::core
The Device class is the base class for devices supported by the device library.
Definition device.h:58
virtual float get_power() const =0
Get power consumption details for the device.
virtual const std::string & get_name() const =0
Get device name.
BaseData base_
Device base data.
Definition device.h:102
virtual DeviceType get_type() const =0
Get device type.
virtual ~Device()=default
Device destructor.
const UID & get_uid() const
Get device UID.
Definition device.h:70
auto & get_tags()
Get tags used by the device.
Definition device.h:77
Class definition for core library basic entities.
Core library namespace.
Definition backend.h:50
DeviceType
The DeviceType class defines IDs of supported device types.
Definition device.h:38
@ AltAI1_NPU
NPU device.
Definition device.h:50
@ CPU
CPU device.
Definition device.h:42
@ GPU
GPU device.
Definition device.h:46