DEENESPTFRRUARHIKOZHNL

class ara::shwa::CpuSelector

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_00408] wording not yet imported Upstream: RS_SHWA_00006

class CpuSelector : 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 hardware devices based on a selector strategy.
AI-GENERATED unreviewed Model: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: 89675708a89b Provenance Open questions (3)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original

Enables the evaluation and targeted selection of hardware devices based on a selector strategy.

Class ara::shwa::CpuSelector serves in module shwa for evaluating and targeted selection of hardware devices according to a specific selector strategy [AP_SWS_SHWA_00410]. Application software can evaluate individual device candidates via operator() or directly determine a suitable target device via method SelectDevice() [AP_SWS_SHWA_00409]. As essential constraints, the interfaces are specified as not thread-safe, provide no rollback semantics, and report potential errors such as occupied resources exclusively via ara::core::Result.

Context

Class ara::shwa::CpuSelector is part of the hardware acceleration module (shwa) within the AUTOSAR Adaptive Platform. It derives from base interface DeviceSelector and specializes the functional selection of execution devices. Its primary responsibility is to evaluate hardware devices (Device) based on a selector strategy or to select a suitable device directly [AP_SWS_SHWA_00409], [AP_SWS_SHWA_00410].

In the overall system, CpuSelector acts as a link between requesting software components and available hardware units. While DeviceSelector provides the general interface, CpuSelector as a selector strategy is likely aimed specifically at CPU-based hardware resources, as suggested by the class name. Question Q-32abbae13e272c68 (open) Application software includes this class to make sound decisions about resource suitability prior to work dispatch.

Lifecycle

Instances of CpuSelector are created in the application context or by higher-level manager instances to provide selection strategies. The central evaluation and selection operations are declared as const, which is why the instance behaves statelessly toward the outside during its use and does not modify any internal selection states [AP_SWS_SHWA_00409], [AP_SWS_SHWA_00410].

Regarding concurrency, neither SelectDevice() [AP_SWS_SHWA_00410] nor operator() [AP_SWS_SHWA_00409] is thread-safe (not thread-safe). Because the methods are specified as not thread-safe, concurrent accesses to the same instance of CpuSelector presumably must be synchronized by the caller. Question Q-fced1ce242dea2c2 (open) At the end of the lifecycle, the selector is torn down without special rollback procedures.

Usage Path

Typical interaction with CpuSelector comprises either the individual evaluation of single candidates or the direct query for the optimal target device. For candidate inspection, the caller passes a device reference to operator()(const Device &device) [AP_SWS_SHWA_00409]. The return of operator() as ara::core::Result<int> is likely to represent a numerical evaluation metric (score) for the passed Device, by which multiple devices can be compared. Question Q-33885b34ba761592 (open)

If the application wants to leave the selection entirely to the strategy, it calls SelectDevice() [AP_SWS_SHWA_00410]. This method internally determines the suitable device and returns a ara::core::Result<Device> that encapsulates the selected target device.

Evaluation and selection of a device with CpuSelectorApplicationCpuSelectorDeviceUse Case: Kandidatenbewertung via operator()operator()(device)Evaluation according to selector strategyResult<int> (Score)Use Case: Direct device selection via SelectDevice()SelectDevice()Auswahl anhand Selektor-StrategieResult<Device>

Sequence diagram: Typical flow for evaluating and selecting a target device via CpuSelector. Sources: [AP_SWS_SHWA_00409], [AP_SWS_SHWA_00410].

Error Scenarios

Both methods are declared with noexcept and guarantee full exception safety (exception safe) [AP_SWS_SHWA_00409], [AP_SWS_SHWA_00410]. Occurring error conditions are not reported via C++ exceptions, but are returned via the error domain in ara::core::Result.

The following error values from ShwaErrorCode are specified for both methods:

As a precondition for operator(), a valid Device reference must be available. Both functions forego rollback semantics (no_rollback_semantics), which is why no automatic cleanup of previous system states occurs in the event of an error [AP_SWS_SHWA_00409], [AP_SWS_SHWA_00410].

This guide was generated 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_00410] 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::CpuSelector
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_00410
Status
valid/unmigrated
Version
AUTOSAR/AP/record/AP_SWS_SHWA_00410@rel:R25-11#25297b84
Content hash
25297b84
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_SafeHardwareAcceleration.pdf#nameddest=AP_SWS_SHWA_00410
Status: valid/unmigrated Version: rel:R25-11#25297b84 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_00410@rel:R25-11#25297b84
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_00409] 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::CpuSelector
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_00409
Status
valid/unmigrated
Version
AUTOSAR/AP/record/AP_SWS_SHWA_00409@rel:R25-11#d547c13d
Content hash
d547c13d
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_SafeHardwareAcceleration.pdf#nameddest=AP_SWS_SHWA_00409
Status: valid/unmigrated Version: rel:R25-11#d547c13d 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_00409@rel:R25-11#d547c13d
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