DEENESPTFRRUARHIKOZHNL

class 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] wording not yet imported 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

User GuideAI-GENERATED

Enables the evaluation and targeted selection of suitable GPU hardware accelerators based on specific criteria.
AI-GENERATED unreviewed Model: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: 7fc4b1cc3332 Provenance Open questions (2)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original

Enables the evaluation and targeted selection of suitable GPU hardware accelerators based on specific criteria.

The class serves to identify and select suitable graphics processors for hardware-accelerated computations in the shwa module. Via interface [AP_SWS_SHWA_00406], the instance evaluates individual devices based on a selector strategy, while [AP_SWS_SHWA_00407] directly selects an optimal target device. Since all calls are defined as not thread-safe, use in concurrent contexts requires explicit synchronization by the caller. Possible error states such as occupied resources are signaled deterministically without exceptions via error codes.

Context

Class ara::shwa::GpuSelector acts in AUTOSAR Adaptive module shwa (Shared Hardware Acceleration) as a selection component for graphics processing units (GPUs). As a specialization of base class DeviceSelector, it undertakes the targeted evaluation and selection of hardware resources for computationally intensive acceleration tasks. Typical scenarios include parallel data processing, machine learning pipelines, or image processing algorithms that place specific demands on the executing computing unit. Within the platform architecture, the class mediates between the higher-level application and the available hardware devices (Device) by applying implemented selection strategies to candidate devices [AP_SWS_SHWA_00406]. This decouples the application logic from hardware-specific detection and evaluation mechanisms.

Lifecycle

Instantiation of ara::shwa::GpuSelector is typically performed by the requesting application component before execution on hardware accelerators is initiated. Interpretation: Since the class inherits from DeviceSelector and exposes no mutable internal states according to the interface definition, it is likely to be operated primarily as a lightweight strategy instance or stateless function object. Question Q-66cfb57fe39be17d (open) The lifetime of the instance is usually tied to the device initialization phase. Regarding concurrency, it should be noted that both operator() [AP_SWS_SHWA_00406] and SelectDevice() [AP_SWS_SHWA_00407] are specified as not thread-safe (not thread-safe). If access occurs from multiple threads, the calling application must ensure external synchronization. Both methods, however, are declared as noexcept and guarantee full exception safety (exception safe).

Usage Path

The interface supports two complementary interaction patterns for hardware selection: manual evaluation of individual candidates and autonomous allocation. In iterative evaluation, the application passes existing devices to call operator operator() [AP_SWS_SHWA_00406]. This checks the respective Device according to the configured strategy and returns the result in the form of a ara::core::Result<int>. Interpretation: The returned integer value is likely to represent a suitability score, by means of which the application can establish a ranking among multiple GPUs. Question Q-7b7666aedeedc755 (open)

Alternatively, the application can call method SelectDevice() [AP_SWS_SHWA_00407]. In this case, the selector autonomously determines the most suitable device from the available resources and directly returns a ara::core::Result<Device>. This path is suitable for systems in which the allocation decision is to be delegated entirely to the selector.

Call sequence for evaluation and selection of GPU devicesApplicationGpuSelectorUse Case: Kandidatenbewertung via Funktoroperator()(device)Result<int> (Score)Use Case: Direct device selectionSelectDevice()Result<Device>

Sequence diagram: Call sequence for evaluation and selection of GPU devices by the application. Sources: [AP_SWS_SHWA_00406], [AP_SWS_SHWA_00407]

Error Scenarios

Since no C++ exceptions are thrown, the class signals error conditions exclusively via return type ara::core::Result. Identical error definitions apply to both methods, and no automatic rollback mechanisms exist (no_rollback_semantics) [AP_SWS_SHWA_00406], [AP_SWS_SHWA_00407]:

  • ShwaErrorCode::kResourceBusy: The operation could not be executed because the requested hardware resource is currently occupied [AP_SWS_SHWA_00406], [AP_SWS_SHWA_00407]. The application can repeat the call at a later point in time or switch to an alternative GPU.
  • ShwaErrorCode::kFeatureNotSupported: The requested feature or required device functionality is not supported by the target platform or device [AP_SWS_SHWA_00406], [AP_SWS_SHWA_00407].

This guide was created by an AI system based on the specification of AUTOSAR Adaptive R25-11.

Methods

SelectDevice function

Bewertet beziehungsweise selektiert ein Device entsprechend der Selektor-Strategie.

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

Operators

operator() function

Bewertet beziehungsweise selektiert ein Device entsprechend der Selektor-Strategie.

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

Details

function 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#6135550b
Content hash
6135550b
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

function 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#9b209298
Content hash
9b209298
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