DEENESPTFRRUARHIKOZHNL

类 ara::shwa::Device

Diese Seite wurde vollständig KI-generiert auf Basis von SWS Safe Hardware Acceleration (R25-11) — kein offizieller AUTOSAR-Text und keine automatisch extrahierte API-Seite wie die übrigen Module. Als Interpretation gekennzeichnete Aussagen sind Schlussfolgerungen aus den Quellen.

[AP_SWS_SHWA_00301] 原文尚未导入 Upstream: RS_SHWA_00001, RS_SHWA_00015

class Device final {...};

Die Spezifikation definiert diesen Klassentyp mit der gezeigten Schnittstelle.

Header-Datei#include "ara/shwa/device.h"
Scopenamespace ara::shwa

用户指南人工智能生成

封装并标识诸如 CPU 和 GPU 等硬件加速器,以安全执行计算密集型任务。
AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: 920debb94b23 来源 未决问题(2)
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

封装并标识诸如 CPU 和 GPU 等硬件加速器,以安全执行计算密集型任务。

用于在 Adaptive Platform AUTOSAR_AP_SWS_SafeHardwareAcceleration 第12页 内抽象和管理硬件加速器。实例仅通过工厂方法(如 Create())创建,并提供用于检查设备类型以及读取特定特征的操作 [AP_SWS_SHWA_00308]、[AP_SWS_SHWA_00313]。由于这些操作不是线程安全的,在多线程环境中使用时需要外部同步。

上下文

类 ara::shwa::Device 在安全硬件加速模块(Safe Hardware Acceleration)中充当物理计算单元的主要抽象 AUTOSAR_AP_SWS_SafeHardwareAcceleration 第12页。在 Adaptive Platform 内,它使 Adaptive Applications 以及其他功能集群能够访问和管理加速器资源。典型的整体系统将 Device 的实例与执行队列(Queues)和内存缓冲区(Buffers)相结合,以便以结构化方式将计算密集型任务委托给加速器硬件 SWS_SafeHardwareAcceleration 第22页。

DeviceContext app Adaptive Application device ara::shwa::Device app->device erzeugt / fragt ab queues Queues & Buffers app->queues 使用 hardware Hardware-Beschleuniger (CPU, GPU, Accelerator) device->hardware abstrahiert queues->device referenziert

上下文图:ara::shwa::Device 与应用程序、队列及硬件交互的嵌入关系。来源:AUTOSAR_AP_SWS_SafeHardwareAcceleration 第12页、SWS_SafeHardwareAcceleration 第22页

生命周期

ara::shwa::Device 对象的创建受到严格控制:默认构造函数被显式删除 [AP_SWS_SHWA_00302]。实例只能通过静态工厂方法 Create() 创建,既可以不带参数用于标准设备 [AP_SWS_SHWA_00308],也可以通过选择器对象使用 Create(const DeviceSelector&) [AP_SWS_SHWA_00309] 进行参数化。两种方法均返回一个 ara::core::Result<Device>。

在资源所有权方面,该类具有常规的复制和移动语义:复制构造函数 [AP_SWS_SHWA_00303] 和复制赋值运算符 [AP_SWS_SHWA_00304] 以及移动构造函数 [AP_SWS_SHWA_00305] 和移动赋值运算符 [AP_SWS_SHWA_00306] 均被声明为 noexcept=default。理解:该对象在内部可能被设计为实际硬件资源的轻量级句柄,从而能够以较低开销且异常安全地进行复制。 问题 Q-a6ff4d89f19b0f36 (未决)物理硬件接口的生命周期与底层驱动程序或子系统的运行时间绑定,而应用程序级别的实例可以像常规值类型一样进行传递。该类的所有工厂调用和方法均被规范为非线程安全。

使用路径

典型的使用路径始于通过工厂方法之一进行实例化。成功返回后,将检查该实例以确定计算单元的类型并查询设备特定参数。随后,设备通常被分配给队列和缓冲区,以执行处理作业。

  1. 实例化:调用 Create() 或 Create(deviceSelector) 以提供设备 [AP_SWS_SHWA_00308]、[AP_SWS_SHWA_00309]。
  2. 类型检查:通过谓词 IsCpu() [AP_SWS_SHWA_00310]、IsGpu() [AP_SWS_SHWA_00311] 或 IsAccelerator() [AP_SWS_SHWA_00312] 验证硬件类别。
  3. 配置查询:通过模板方法 GetInfo<InfoType>() [AP_SWS_SHWA_00313] 读取详细的设备信息。
Device 的典型初始化与信息查询应用DeviceCreate(deviceSelector)Result<Device>IsGpu()Result<bool>GetInfo<InfoType>()Result<ReturnType>

时序图:初始化、类型检查和信息查询的典型顺序。来源:[AP_SWS_SHWA_00309]、[AP_SWS_SHWA_00311]、[AP_SWS_SHWA_00313]

错误场景

ara::shwa::Device 的方法通过错误类型 ara::core::Result 确定性地传达错误状态。规范了以下错误情况:

在异常安全性方面,所有操作均被视为 exception safe 或带有 noexcept 注解。由于这些操作不是线程安全的,在同一实例或共享硬件资源上的并发调用必须由应用层进行同步。

本指南基于 AUTOSAR 标准 R25-11 自动生成。

成员图

构造函数和析构函数

1

运算符

1

详细视图

请在大纲中选择一个条目。

构造函数和析构函数

Device 函数 3

Die Spezifikation definiert diese Deklaration mit der in der Signatur ausgewiesenen Semantik.

重载 Device 3
Device ()=delete; AP_SWS_SHWA_00302
Device (Device &&dev) noexcept=default; AP_SWS_SHWA_00305
Device (Device const &dev) noexcept=default; AP_SWS_SHWA_00303

方法

Create 函数 2

Erzeugt beziehungsweise liefert das in der Signatur beschriebene Objekt oder Ergebnis über den angegebenen Factory-Pfad.

重载 Create 2
template <typename DeviceSelector> static ara::core::Result< Device > Create (const DeviceSelector &deviceSelector) noexcept; AP_SWS_SHWA_00309
static ara::core::Result< Device > Create () noexcept; AP_SWS_SHWA_00308
GetInfo 函数

Liest die durch die Signatur bezeichnete Information oder Eigenschaft aus dem Objekt.

template <typename InfoType> ara::core::Result< typename InfoType::ReturnType > GetInfo () const noexcept;

Prüft die in der Signatur bezeichnete Eigenschaft des Devices oder der Queue.

ara::core::Result< bool > IsAccelerator () const noexcept;
IsCpu 函数

Prüft die in der Signatur bezeichnete Eigenschaft des Devices oder der Queue.

ara::core::Result< bool > IsCpu () const noexcept;
IsGpu 函数

Prüft die in der Signatur bezeichnete Eigenschaft des Devices oder der Queue.

ara::core::Result< bool > IsGpu () const noexcept;

运算符

operator= 函数 2

Stellt die in der Signatur ausgewiesene Index- beziehungsweise Zuweisungsoperation bereit.

重载 = 2
Device & operator= (Device &&dev) noexcept=default; AP_SWS_SHWA_00306
Device & operator= (const Device &dev) noexcept=default; AP_SWS_SHWA_00304

详细信息

函数 Device [AP_SWS_SHWA_00302] Upstream: RS_SHWA_00015

Device ()=delete;

Die Spezifikation definiert diese Deklaration mit der in der Signatur ausgewiesenen Semantik.

Scopeclass ara::shwa::Device

Request a governed re-review of this record. The record is not changed immediately.

Record
AUTOSAR/AP/record/AP_SWS_SHWA_00302
Status
valid/unmigrated
Version
AUTOSAR/AP/record/AP_SWS_SHWA_00302@rel:R25-11#427ec18e
Content hash
427ec18e
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_SafeHardwareAcceleration.pdf#nameddest=AP_SWS_SHWA_00302
Status: valid/unmigrated Version: rel:R25-11#aef4a102 Versionshistorie & Revisions (1 transition)
Current State
valid/unmigrated
Reason
mechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record
Campaign
2026-08-13-status-backfill
Active Version
AUTOSAR/AP/record/AP_SWS_SHWA_00302@rel:R25-11#aef4a102
Point-in-Time History:
DateActorTransitionReason / RationaleCampaign
2026-08-13toolnone → valid/unmigratedmechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record2026-08-13-status-backfill

函数 Device [AP_SWS_SHWA_00305] Upstream: RS_SHWA_00015

Device (Device &&dev) noexcept=default;

Die Spezifikation definiert diese Deklaration mit der in der Signatur ausgewiesenen Semantik.

Scopeclass ara::shwa::Device
Exception Safetyexception safe

Request a governed re-review of this record. The record is not changed immediately.

Record
AUTOSAR/AP/record/AP_SWS_SHWA_00305
Status
valid/unmigrated
Version
AUTOSAR/AP/record/AP_SWS_SHWA_00305@rel:R25-11#12ab24ef
Content hash
12ab24ef
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_SafeHardwareAcceleration.pdf#nameddest=AP_SWS_SHWA_00305
Status: valid/unmigrated Version: rel:R25-11#8a2c1f5f Versionshistorie & Revisions (1 transition)
Current State
valid/unmigrated
Reason
mechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record
Campaign
2026-08-13-status-backfill
Active Version
AUTOSAR/AP/record/AP_SWS_SHWA_00305@rel:R25-11#8a2c1f5f
Point-in-Time History:
DateActorTransitionReason / RationaleCampaign
2026-08-13toolnone → valid/unmigratedmechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record2026-08-13-status-backfill

函数 operator= [AP_SWS_SHWA_00306] Upstream: RS_SHWA_00015

Device & operator= (Device &&dev) noexcept=default;

Stellt die in der Signatur ausgewiesene Index- beziehungsweise Zuweisungsoperation bereit.

Scopeclass ara::shwa::Device
Exception Safetyexception safe

Request a governed re-review of this record. The record is not changed immediately.

Record
AUTOSAR/AP/record/AP_SWS_SHWA_00306
Status
valid/unmigrated
Version
AUTOSAR/AP/record/AP_SWS_SHWA_00306@rel:R25-11#2af0b4d0
Content hash
2af0b4d0
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_SafeHardwareAcceleration.pdf#nameddest=AP_SWS_SHWA_00306
Status: valid/unmigrated Version: rel:R25-11#bf26e06b Versionshistorie & Revisions (1 transition)
Current State
valid/unmigrated
Reason
mechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record
Campaign
2026-08-13-status-backfill
Active Version
AUTOSAR/AP/record/AP_SWS_SHWA_00306@rel:R25-11#bf26e06b
Point-in-Time History:
DateActorTransitionReason / RationaleCampaign
2026-08-13toolnone → valid/unmigratedmechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record2026-08-13-status-backfill

函数 operator= [AP_SWS_SHWA_00304] Upstream: RS_SHWA_00015

Device & operator= (const Device &dev) noexcept=default;

Stellt die in der Signatur ausgewiesene Index- beziehungsweise Zuweisungsoperation bereit.

Scopeclass ara::shwa::Device
Exception Safetyexception safe

Request a governed re-review of this record. The record is not changed immediately.

Record
AUTOSAR/AP/record/AP_SWS_SHWA_00304
Status
valid/unmigrated
Version
AUTOSAR/AP/record/AP_SWS_SHWA_00304@rel:R25-11#8d437c26
Content hash
8d437c26
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_SafeHardwareAcceleration.pdf#nameddest=AP_SWS_SHWA_00304
Status: valid/unmigrated Version: rel:R25-11#10c34f3d Versionshistorie & Revisions (1 transition)
Current State
valid/unmigrated
Reason
mechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record
Campaign
2026-08-13-status-backfill
Active Version
AUTOSAR/AP/record/AP_SWS_SHWA_00304@rel:R25-11#10c34f3d
Point-in-Time History:
DateActorTransitionReason / RationaleCampaign
2026-08-13toolnone → valid/unmigratedmechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record2026-08-13-status-backfill

函数 Device [AP_SWS_SHWA_00303] Upstream: RS_SHWA_00015

Device (Device const &dev) noexcept=default;

Die Spezifikation definiert diese Deklaration mit der in der Signatur ausgewiesenen Semantik.

Scopeclass ara::shwa::Device
Exception Safetyexception safe

Request a governed re-review of this record. The record is not changed immediately.

Record
AUTOSAR/AP/record/AP_SWS_SHWA_00303
Status
valid/unmigrated
Version
AUTOSAR/AP/record/AP_SWS_SHWA_00303@rel:R25-11#19597351
Content hash
19597351
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_SafeHardwareAcceleration.pdf#nameddest=AP_SWS_SHWA_00303
Status: valid/unmigrated Version: rel:R25-11#0b94a2cf Versionshistorie & Revisions (1 transition)
Current State
valid/unmigrated
Reason
mechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record
Campaign
2026-08-13-status-backfill
Active Version
AUTOSAR/AP/record/AP_SWS_SHWA_00303@rel:R25-11#0b94a2cf
Point-in-Time History:
DateActorTransitionReason / RationaleCampaign
2026-08-13toolnone → valid/unmigratedmechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record2026-08-13-status-backfill

函数 Create [AP_SWS_SHWA_00309] Upstream: RS_SHWA_00015, RS_SHWA_00006, RS_SHWA_00007

template <typename DeviceSelector> static ara::core::Result< Device > Create (const DeviceSelector &deviceSelector) noexcept;

Erzeugt beziehungsweise liefert das in der Signatur beschriebene Objekt oder Ergebnis über den angegebenen Factory-Pfad.

Scopeclass ara::shwa::Device
Thread Safetynot thread-safe rollback_semantics ShwaErrorCode::k ResourceBusy The operation could not be performed because the resource is currently busy rollback_semantics
Exception Safetyexception safe
ErrorsShwaErrorCode::k FeatureNotSupported Used when a requested feature isn’t supported

Request a governed re-review of this record. The record is not changed immediately.

Record
AUTOSAR/AP/record/AP_SWS_SHWA_00309
Status
valid/unmigrated
Version
AUTOSAR/AP/record/AP_SWS_SHWA_00309@rel:R25-11#deedfc9b
Content hash
deedfc9b
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_SafeHardwareAcceleration.pdf#nameddest=AP_SWS_SHWA_00309
Status: valid/unmigrated Version: rel:R25-11#aab7bd32 Versionshistorie & Revisions (1 transition)
Current State
valid/unmigrated
Reason
mechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record
Campaign
2026-08-13-status-backfill
Active Version
AUTOSAR/AP/record/AP_SWS_SHWA_00309@rel:R25-11#aab7bd32
Point-in-Time History:
DateActorTransitionReason / RationaleCampaign
2026-08-13toolnone → valid/unmigratedmechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record2026-08-13-status-backfill

函数 Create [AP_SWS_SHWA_00308] Upstream: RS_SHWA_00015, RS_SHWA_00007

static ara::core::Result< Device > Create () noexcept;

Erzeugt beziehungsweise liefert das in der Signatur beschriebene Objekt oder Ergebnis über den angegebenen Factory-Pfad.

Scopeclass ara::shwa::Device
Thread Safetynot thread-safe rollback_semantics ShwaErrorCode::k ResourceBusy The operation could not be performed because the resource is currently busy rollback_semantics
Exception Safetyexception safe
ErrorsShwaErrorCode::k FeatureNotSupported Used when a requested feature isn’t supported

Request a governed re-review of this record. The record is not changed immediately.

Record
AUTOSAR/AP/record/AP_SWS_SHWA_00308
Status
valid/unmigrated
Version
AUTOSAR/AP/record/AP_SWS_SHWA_00308@rel:R25-11#a5166e8d
Content hash
a5166e8d
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_SafeHardwareAcceleration.pdf#nameddest=AP_SWS_SHWA_00308
Status: valid/unmigrated Version: rel:R25-11#6c55f83b Versionshistorie & Revisions (1 transition)
Current State
valid/unmigrated
Reason
mechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record
Campaign
2026-08-13-status-backfill
Active Version
AUTOSAR/AP/record/AP_SWS_SHWA_00308@rel:R25-11#6c55f83b
Point-in-Time History:
DateActorTransitionReason / RationaleCampaign
2026-08-13toolnone → valid/unmigratedmechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record2026-08-13-status-backfill

函数 GetInfo [AP_SWS_SHWA_00313] Upstream: RS_SHWA_00014, RS_SHWA_00015, RS_SHWA_00007

template <typename InfoType> ara::core::Result< typename InfoType::ReturnType > GetInfo () const noexcept;

Liest die durch die Signatur bezeichnete Information oder Eigenschaft aus dem Objekt.

Scopeclass ara::shwa::Device
Thread Safetynot thread-safe rollback_semantics
Exception Safetyexception safe
ErrorsShwaErrorCode::k FeatureNotSupported Used when a requested feature isn’t supported

Request a governed re-review of this record. The record is not changed immediately.

Record
AUTOSAR/AP/record/AP_SWS_SHWA_00313
Status
valid/unmigrated
Version
AUTOSAR/AP/record/AP_SWS_SHWA_00313@rel:R25-11#2b662426
Content hash
2b662426
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_SafeHardwareAcceleration.pdf#nameddest=AP_SWS_SHWA_00313
Status: valid/unmigrated Version: rel:R25-11#bc5de536 Versionshistorie & Revisions (1 transition)
Current State
valid/unmigrated
Reason
mechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record
Campaign
2026-08-13-status-backfill
Active Version
AUTOSAR/AP/record/AP_SWS_SHWA_00313@rel:R25-11#bc5de536
Point-in-Time History:
DateActorTransitionReason / RationaleCampaign
2026-08-13toolnone → valid/unmigratedmechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record2026-08-13-status-backfill

函数 IsAccelerator [AP_SWS_SHWA_00312] Upstream: RS_SHWA_00014, RS_SHWA_00015, RS_SHWA_00007

ara::core::Result< bool > IsAccelerator () const noexcept;

Prüft die in der Signatur bezeichnete Eigenschaft des Devices oder der Queue.

Scopeclass ara::shwa::Device
Thread Safetynot thread-safe rollback_semantics
Exception Safetyexception safe
ErrorsShwaErrorCode::k ResourceBusy The operation could not be performed because the resource is currently busy

Request a governed re-review of this record. The record is not changed immediately.

Record
AUTOSAR/AP/record/AP_SWS_SHWA_00312
Status
valid/unmigrated
Version
AUTOSAR/AP/record/AP_SWS_SHWA_00312@rel:R25-11#5fdb9481
Content hash
5fdb9481
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_SafeHardwareAcceleration.pdf#nameddest=AP_SWS_SHWA_00312
Status: valid/unmigrated Version: rel:R25-11#4ea7c619 Versionshistorie & Revisions (1 transition)
Current State
valid/unmigrated
Reason
mechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record
Campaign
2026-08-13-status-backfill
Active Version
AUTOSAR/AP/record/AP_SWS_SHWA_00312@rel:R25-11#4ea7c619
Point-in-Time History:
DateActorTransitionReason / RationaleCampaign
2026-08-13toolnone → valid/unmigratedmechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record2026-08-13-status-backfill

函数 IsCpu [AP_SWS_SHWA_00310] Upstream: RS_SHWA_00014, RS_SHWA_00015, RS_SHWA_00007

ara::core::Result< bool > IsCpu () const noexcept;

Prüft die in der Signatur bezeichnete Eigenschaft des Devices oder der Queue.

Scopeclass ara::shwa::Device
Thread Safetynot thread-safe rollback_semantics
Exception Safetyexception safe
ErrorsShwaErrorCode::k ResourceBusy The operation could not be performed because the resource is currently busy

Request a governed re-review of this record. The record is not changed immediately.

Record
AUTOSAR/AP/record/AP_SWS_SHWA_00310
Status
valid/unmigrated
Version
AUTOSAR/AP/record/AP_SWS_SHWA_00310@rel:R25-11#82219e46
Content hash
82219e46
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_SafeHardwareAcceleration.pdf#nameddest=AP_SWS_SHWA_00310
Status: valid/unmigrated Version: rel:R25-11#d8084c02 Versionshistorie & Revisions (1 transition)
Current State
valid/unmigrated
Reason
mechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record
Campaign
2026-08-13-status-backfill
Active Version
AUTOSAR/AP/record/AP_SWS_SHWA_00310@rel:R25-11#d8084c02
Point-in-Time History:
DateActorTransitionReason / RationaleCampaign
2026-08-13toolnone → valid/unmigratedmechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record2026-08-13-status-backfill

函数 IsGpu [AP_SWS_SHWA_00311] Upstream: RS_SHWA_00014, RS_SHWA_00015, RS_SHWA_00007

ara::core::Result< bool > IsGpu () const noexcept;

Prüft die in der Signatur bezeichnete Eigenschaft des Devices oder der Queue.

Scopeclass ara::shwa::Device
Thread Safetynot thread-safe rollback_semantics
Exception Safetyexception safe
ErrorsShwaErrorCode::k ResourceBusy The operation could not be performed because the resource is currently busy

Request a governed re-review of this record. The record is not changed immediately.

Record
AUTOSAR/AP/record/AP_SWS_SHWA_00311
Status
valid/unmigrated
Version
AUTOSAR/AP/record/AP_SWS_SHWA_00311@rel:R25-11#bd8b731d
Content hash
bd8b731d
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_SafeHardwareAcceleration.pdf#nameddest=AP_SWS_SHWA_00311
Status: valid/unmigrated Version: rel:R25-11#66b23ae4 Versionshistorie & Revisions (1 transition)
Current State
valid/unmigrated
Reason
mechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record
Campaign
2026-08-13-status-backfill
Active Version
AUTOSAR/AP/record/AP_SWS_SHWA_00311@rel:R25-11#66b23ae4
Point-in-Time History:
DateActorTransitionReason / RationaleCampaign
2026-08-13toolnone → valid/unmigratedmechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record2026-08-13-status-backfill