DEENESPTFRRUARHIKOZHNL

类 ara::shwa::GpuSelector

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_00405] 原文尚未导入 Upstream: RS_SHWA_00006

class GpuSelector : public DeviceSelector {...};

Die Spezifikation definiert diesen Klassentyp mit der gezeigten Schnittstelle.

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

用户指南人工智能生成

支持根据特定标准对合适的GPU硬件加速器进行评估与针对性选择。
AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: 7fc4b1cc3332 来源 未决问题(2)
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

支持根据特定标准对合适的GPU硬件加速器进行评估与针对性选择。

此类用于识别和选择适用于shwa模块中硬件加速计算的图形处理器。该实例通过接口[AP_SWS_SHWA_00406]根据选择器策略评估各个设备,而[AP_SWS_SHWA_00407]则直接选择最佳目标设备。由于所有调用均定义为非线程安全,因此在并发上下文中使用时需要调用方进行显式同步。可能的错误状态(如资源被占用)均通过错误代码确定性地提示,不引发异常。

上下文

类ara::shwa::GpuSelector在AUTOSAR Adaptive模块shwa(Shared Hardware Acceleration)中充当图形处理器(GPU)的选择组件。作为基类DeviceSelector的特化,它负责针对计算密集型加速任务对硬件资源进行针对性评估和选择。典型场景包括并行数据处理、机器学习流水线或图像处理算法,这些场景对执行计算单元提出了特定要求。在平台架构内部,此类通过对候选设备应用已实现的选择策略([AP_SWS_SHWA_00406]),在更高级别的应用程序与可用硬件设备(Device)之间进行协调。由此,应用逻辑与特定于硬件的识别和评估机制实现了解耦。

生命周期

在硬件加速器上启动执行之前,通常由请求应用组件对ara::shwa::GpuSelector进行实例化。解读:由于此类继承自DeviceSelector且根据接口定义不公开可变内部状态,因此它很可能主要作为轻量级策略实例或无状态函数对象运行。 问题 Q-66cfb57fe39be17d (未决)该实例的生命周期通常与设备初始化阶段绑定。在并发方面需要注意的是,operator() [AP_SWS_SHWA_00406]以及SelectDevice() [AP_SWS_SHWA_00407]均被指定为非线程安全(not thread-safe)。如果从多个线程进行访问,则调用应用程序必须确保外部同步。但是,这两种方法均声明为noexcept,并保证完全的异常安全性(exception safe)。

使用路径

该接口支持两种互补的硬件选择交互模式:单独候选对象的受控评估以及自主分配。在迭代评估时,应用程序将现有设备传递给调用运算符operator() [AP_SWS_SHWA_00406]。该运算符根据所配置的策略检查对应的Device,并以ara::core::Result<int>的形式返回结果。解读:返回的整数值应表示适用性分数,应用程序可据此在多个GPU之间建立排名。 问题 Q-7b7666aedeedc755 (未决)

或者,应用程序也可以调用方法SelectDevice() [AP_SWS_SHWA_00407]。此时,选择器自主从可用资源中确定最合适的设备,并直接返回一个ara::core::Result<Device>。该路径适用于应将分配决策完全委托给选择器的系统。

GPU 设备评估与选择的调用序列应用GpuSelectorUse Case: Kandidatenbewertung via Funktoroperator()(device)Result<int> (Score)Use Case: 直接设备选择SelectDevice()Result<Device>

时序图:应用程序评估和选择GPU设备的调用序列。来源:[AP_SWS_SHWA_00406]、[AP_SWS_SHWA_00407]

错误场景

由于不抛出C++异常,该类仅通过返回类型ara::core::Result指示错误状态。这两种方法适用相同的错误定义,并且不存在自动回滚机制(no_rollback_semantics)[AP_SWS_SHWA_00406]、[AP_SWS_SHWA_00407]:

本指南由AI系统基于AUTOSAR Adaptive R25-11规范生成。

方法

Bewertet beziehungsweise selektiert ein Device entsprechend der Selektor-Strategie.

virtual ara::core::Result< Device > SelectDevice () const noexcept override;

运算符

operator() 函数

Bewertet beziehungsweise selektiert ein Device entsprechend der Selektor-Strategie.

ara::core::Result< int > operator() (const Device &device) const noexcept override;

详细信息

函数 SelectDevice [AP_SWS_SHWA_00407] Upstream: RS_SHWA_00006, RS_SHWA_00007

virtual ara::core::Result< Device > SelectDevice () const noexcept override;

Bewertet beziehungsweise selektiert ein Device entsprechend der Selektor-Strategie.

Scopeclass ara::shwa::GpuSelector
Thread Safetynot thread-safe no_rollback_semantics ShwaErrorCode::k ResourceBusy The operation could not be performed because the resource is currently busy no_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_00407
Status
valid/unmigrated
Version
AUTOSAR/AP/record/AP_SWS_SHWA_00407@rel:R25-11#575e1929
Content hash
575e1929
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_SafeHardwareAcceleration.pdf#nameddest=AP_SWS_SHWA_00407
Status: valid/unmigrated Version: rel:R25-11#6135550b 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_00407@rel:R25-11#6135550b
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_00406] Upstream: RS_SHWA_00006, RS_SHWA_00007

ara::core::Result< int > operator() (const Device &device) const noexcept override;

Bewertet beziehungsweise selektiert ein Device entsprechend der Selektor-Strategie.

Scopeclass ara::shwa::GpuSelector
Thread Safetynot thread-safe no_rollback_semantics ShwaErrorCode::k ResourceBusy The operation could not be performed because the resource is currently busy no_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_00406
Status
valid/unmigrated
Version
AUTOSAR/AP/record/AP_SWS_SHWA_00406@rel:R25-11#ba526cf8
Content hash
ba526cf8
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_SafeHardwareAcceleration.pdf#nameddest=AP_SWS_SHWA_00406
Status: valid/unmigrated Version: rel:R25-11#9b209298 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_00406@rel:R25-11#9b209298
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