DEENESPTFRRUARHIKOZHNL

namespace ara::shwa

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.

160 API-Records in Kapitel 8: 18 Klassen, 120 Funktionen, 4 Enumerationen und 3 Typ-Aliasse.

User GuideAI-GENERATED

Enables safe offloading of compute-intensive tasks to specialized hardware accelerators.
AI-GENERATED unreviewed Model: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: 94872e9e2305 Provenance Open questions (2)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original

Enables safe offloading of compute-intensive tasks to specialized hardware accelerators.

Namespace ara::shwa provides interfaces for safe hardware acceleration and enables targeted offloading of parallel computing tasks to devices such as GPUs or CPUs via target format Target ([AP_SWS_SHWA_00102]). Applications select accelerators via selectors, create exclusively managed execution queues, and control memory access via buffer accessors. As a central constraint, a strict ownership model with non-copyable resources as well as exception-free error signaling via ShwaErrorCode ([AP_SWS_SHWA_01301]) applies.

Context

Within the AUTOSAR Adaptive Platform, the namespace ara::shwa (Safe Hardware Acceleration) provides interfaces to offload computationally intensive tasks to specialized hardware accelerators. The module enables the integration of different accelerator types such as graphics processing units (GPU), digital signal processors, or dedicated central processing units (CPU).

Detection of the system environment is performed via the Platform class, which discovers the hardware platforms available on the ECU and lists the associated Device instances. The selection of a suitable device can be controlled dynamically or statically via specialized selectors: DeviceSelector acts as a callable function object for prioritizing available units based on an integer rank, while CpuSelector, GpuSelector, and AcceleratorSelector specifically target specific execution units. The current operating state of an accelerator is represented via the enumeration DeviceStatus ([AP_SWS_SHWA_00103]).

The Queue is responsible for the parallel execution of computational operations. Computation tasks are encapsulated via TaskHandler, where the execution location is specified via Target ([AP_SWS_SHWA_00102]) optionally on the accelerator (kDevice) or on the host CPU (kHostTask). Memory regions for input and output data are allocated via Buffer using the dimension specification Range. Access to these buffers is governed by Accessor objects, which restrict the access mode via AccessMode ([AP_SWS_SHWA_00101]).

context Application Application Platform Platform Application->Platform fragt ab DeviceSelector DeviceSelector Application->DeviceSelector uses Queue Queue Application->Queue besitzt Buffer Buffer Application->Buffer besitzt Device Device Platform->Device listet DeviceSelector->Device selects Queue->Device bindet TaskHandler TaskHandler Queue->TaskHandler erzeugt Event Event Queue->Event erzeugt Range Range Buffer->Range beschreibt Accessor Accessor Buffer->Accessor erzeugt

Context diagram: Interplay of the core classes for hardware selection, memory management, and task execution. Sources: [AP_SWS_SHWA_00101], [AP_SWS_SHWA_00102], [AP_SWS_SHWA_00103]

Lifecycle

The resource and lifecycle model in ara::shwa strictly distinguishes between resource-owning objects, descriptive handles, and queue-dependent components:

  • Resource-owning classes: Queue, Buffer, and Accessor manage hardware resources and memory areas exclusively. They are not copyable (not copyable) and must be managed via std::unique_ptr. Passing or transferring them is permitted exclusively via move semantics.
  • Descriptive handles and utility classes: Platform, Device, DeviceMonitor, Id, Range, and PropertyList do not own hardware resources exclusively. They are designed to be copyable. An instance of Device merely represents an access interface to a device, but does not control it exclusively. Interpretation: The initialization of an execution queue (Queue) binds to a specific, previously selected Device, since Queue manages resources exclusively. Question Q-c38811a811f133d0 (open)
  • Dependent components: The classes Event (for synchronization) and TaskHandler (for task processing) can be created exclusively within a Queue; outside the context of a queue, they have no functional significance.

The lifecycle of a device is reflected in DeviceStatus ([AP_SWS_SHWA_00103]): in addition to the operational state kReady, a device can be indicated as not accessible (kNotAccesible), faulty (kFailure), or unknown (kUnknown). Interpretation: State changes of a device between kReady, kNotAccesible, and kFailure are detected at runtime via utility classes such as the DeviceMonitor or the platform. Question Q-8fc0dc95534dc8bc (open)

Usage Path

The typical usage of ara::shwa to execute an accelerated computation is divided into five steps:

  1. Platform and device selection: The application retrieves the existing hardware platforms and their assigned Device instances via Platform. A selector (such as DeviceSelector, GpuSelector, or CpuSelector) determines the most suitable device whose DeviceStatus ([AP_SWS_SHWA_00103]) exhibits the status kReady.
  2. Instantiating the queue: For the selected Device, a Queue is created and held as std::unique_ptr.
  3. Allocating and preparing memory: For input and output data, a Buffer with the required dimensions is created via Range. For population or evaluation, the application requests a Accessor, where the access mode is declared via AccessMode ([AP_SWS_SHWA_00101]) as kRead, kWrite, or kReadWrite.
  4. Registering and executing the task: Within the Queue, a TaskHandler is created. Execution is started, where Target ([AP_SWS_SHWA_00102]) specifies whether the task runs on the accelerator (kDevice) or on the host (kHostTask).
  5. Synchronization: The Queue provides a Event with which the host application monitors the asynchronous completion of computations on the hardware accelerator and synchronizes data alignment.
Usage path for task processing in ara::shwaApplicationPlatformDeviceSelectorQueueBufferQuery available devicesListe von Device-ObjektenSelect deviceSelected deviceInstantiate queue for deviceCreate buffer with rangeRequest accessor with AccessModeAccessor bereitstellenPass TaskHandler with targetCreate event for synchronization

Sequence diagram: Sequence from platform query through buffer allocation to synchronized execution. Sources: [AP_SWS_SHWA_00101], [AP_SWS_SHWA_00102], [AP_SWS_SHWA_00103]

Error Scenarios

The application programming interface of ara::shwa is designed to be exception-free (exception-free). Error states are returned synchronously via ara::core::ErrorCode. Error codes are created via the factory function MakeErrorCode ([AP_SWS_SHWA_01312]) with reference to the error domain GetShwaDomain ([AP_SWS_SHWA_01311]). If the application architecture provides an exception-based error model, the error code can be converted into a ShwaException and thrown.

The enumeration ShwaErrorCode ([AP_SWS_SHWA_01301]) specifies standardized error causes:

  • Memory and access issues: If the allocation of main memory fails, this results in kMemoryNotAllocated. If the data consistency of a buffer cannot be maintained, kIntegrityCorrupted is reported. Invalid access modes or failing operations on Accessor objects lead to kInvalidAccessMode or kAccessorFailure, respectively.
  • Execution and synchronization errors: If the processing of a task on the target device fails, kTaskExecutionFailure is signaled. Illegal operations on synchronization objects lead to kEventInvalidOperation, while blocked resources trigger kResourceBusy. If configured execution times are exceeded, kTimedOut is returned.
  • Invalid parameters and object states: Calling methods on destroyed or invalid objects leads to kInvalidObject. Invalid indices or parameters are rejected via kInvalidIndex or kInvalidParameter, respectively. Unsupported functions report kFeatureNotSupported, while general errors are captured via kRuntime.

The ErrorHandler class is used for handling errors that occur during asynchronous computations on the accelerator.

This guide is based exclusively on the specification for ara::shwa in AUTOSAR R25-11.

Topic map

KI-gestützte Gruppierung auf Basis der Records und Spezifikationsauszüge; keine Gliederung aus der AUTOSAR-Spezifikation.

Detail view

Select an entry in the outline.

Geräteauswahl

AcceleratorSelector manages accelerator selection for operations on HWA if available.

CpuSelector manages CPU selection for operations on HWA if available Allows to get a device from any supported backends for which the device type is CPU.

Class allowing to choose the most appropriate device of the available ones. This is a callable object taking a device reference and returning an integer rank. One of the device with the highest non-negative value is selected.

GpuSelector manages GPU selection for operations on HWA if available Select a device from any supported backends for which the device type is GPU.

Geräteabstraktion

Device class

Device class represents HWA device. Provides access to the device but not controlling it. Designed as copyable since not owning resources.

DeviceMonitor API class. Designed as copyable since not owning resources.

Id class

Id API class. Designed as copyable since not owning resources.

Platform class

Platform class is responsible for extracting different HWA platforms available for current application and listing Devices bind to each platform. Designed as copyable since not owning resources.

DeviceStatus enumeration

Die Enumeration definiert die folgenden standardisierten Werte.

enum class DeviceStatus : std::uint32_t {...};

Speicherzugriff

Accessor class

Accessor manages read and write access to allocated memory by Buffer. Designed as not copyable, since it’s owning resources. Intended to be managed exclusively by std::unique_ptr, which may be moved. ≙ std::unique_ptr

Buffer class

Buffer manages memory allocation for operations on the host or/and HWA. Designed as not copyable, since it’s owning resources. Intended to be managed exclusively by std::unique_ptr, which may be moved. ≙ std::unique_ptr

Range class

Defines size of Buffer for one, two or three dimensions. Designed as copyable since not owning resources.

AccessMode enumeration

Die Enumeration definiert die folgenden standardisierten Werte.

enum class AccessMode : std::uint32_t {...};
Target enumeration

Die Enumeration definiert die folgenden standardisierten Werte.

enum class Target : std::uint32_t {...};

Auftragsausführung

Event class

Event class helps to manage task execution synchronization between HWA and Host application. Can be created only inside of the Queue otherwise it’s meaningless.

Queue class

Queue API provides the functionality for parallel processing on selected Device. Designed as not copyable, since it’s owning resources. Intended to be managed exclusively by std::unique_ ptr, which may be moved. ≙ std::unique_

Handles tasks execution on the selected Device Can be created only inside of the Queue otherwise it’s meaningless.

Fehlerbehandlung

ErrorHandler manages asynchronous error handling for operations on HWA.

Defines the error domain for Safe Hardware Acceleration.

Exception type could be thrown by application or other FC using Safe Hardware Acceleration. Safe Hardware Acceleration API is exception free and can only return an ErrorCode, but user code can transform this error to exception and throw if it’s alligned with system error handling architecture.

GetShwaDomain function

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

constexpr const ara::core::ErrorDomain & GetShwaDomain () noexcept;
MakeErrorCode function

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

constexpr ara::core::ErrorCode MakeErrorCode (ShwaErrorCode code, ara::core::ErrorDomain::SupportDataType data) noexcept;
ShwaErrorCode enumeration

Die Enumeration definiert die folgenden standardisierten Werte.

enum class ShwaErrorCode : ara::core::ErrorDomain::CodeType {...};

Herstellereigenschaften

Property List class is designed to enable vendor specific SHWA functionality extension and adjustment. Properties are not standardized and can be defined by Vendor. Class using Property list is obliged to have HasProperty() and GetProperty() methods defined.

Enumerations

enumeration AccessMode [AP_SWS_SHWA_00101] Upstream: RS_SHWA_00017

enum class AccessMode : std::uint32_t {...};

Die Enumeration definiert die folgenden standardisierten Werte.

Werte

  • kRead — Nur-Lesen-Modus.
  • kWrite — Nur-Schreiben-Modus.
  • kReadWrite — Lese-/Schreibmodus.

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

Record
AUTOSAR/AP/record/AP_SWS_SHWA_00101
Status
valid/unmigrated
Version
AUTOSAR/AP/record/AP_SWS_SHWA_00101@rel:R25-11#08a7ea1b
Content hash
08a7ea1b
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_SafeHardwareAcceleration.pdf#nameddest=AP_SWS_SHWA_00101
Status: valid/unmigrated Version: rel:R25-11#08a7ea1b 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_00101@rel:R25-11#08a7ea1b
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

enumeration DeviceStatus [AP_SWS_SHWA_00103] Upstream: RS_SHWA_00004

enum class DeviceStatus : std::uint32_t {...};

Die Enumeration definiert die folgenden standardisierten Werte.

Werte

  • kReady (= 0) — Device ist für die Task-Ausführung bereit.
  • kNotAccesible (= 1) — Device ist nicht zugänglich.
  • kFailure (= 2) — Device im Fehlerzustand.
  • kUnknown (= 255) — Status kann nicht bestimmt werden.

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

Record
AUTOSAR/AP/record/AP_SWS_SHWA_00103
Status
valid/unmigrated
Version
AUTOSAR/AP/record/AP_SWS_SHWA_00103@rel:R25-11#41762982
Content hash
41762982
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_SafeHardwareAcceleration.pdf#nameddest=AP_SWS_SHWA_00103
Status: valid/unmigrated Version: rel:R25-11#41762982 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_00103@rel:R25-11#41762982
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

enumeration Target [AP_SWS_SHWA_00102] Upstream: RS_SHWA_00001, RS_SHWA_00017

enum class Target : std::uint32_t {...};

Die Enumeration definiert die folgenden standardisierten Werte.

Werte

  • kDevice — Task läuft auf dem Gerät beziehungsweise Beschleuniger.
  • kHostTask — Task läuft auf dem Host (CPU).

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

Record
AUTOSAR/AP/record/AP_SWS_SHWA_00102
Status
valid/unmigrated
Version
AUTOSAR/AP/record/AP_SWS_SHWA_00102@rel:R25-11#8cd54cba
Content hash
8cd54cba
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_SafeHardwareAcceleration.pdf#nameddest=AP_SWS_SHWA_00102
Status: valid/unmigrated Version: rel:R25-11#8cd54cba 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_00102@rel:R25-11#8cd54cba
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

enumeration ShwaErrorCode [AP_SWS_SHWA_01301] Upstream: RS_AP_00122, RS_AP_00125, RS_AP_00127, RS_AP_00149

enum class ShwaErrorCode : ara::core::ErrorDomain::CodeType {...};

Die Enumeration definiert die folgenden standardisierten Werte.

Werte

  • kRuntime (= 1) — allgemeiner Laufzeitfehler.
  • kTaskExecutionFailure (= 2) — Fehler bei der Task-Ausführung.
  • kMemoryNotAllocated (= 3) — Speicherallokation fehlgeschlagen.
  • kIntegrityCorrupted (= 4) — Integrität eines Buffer-Speichers nicht herstellbar.
  • kResourceBusy (= 5) — Ressource ist belegt.
  • kInvalidAccessMode (= 6) — Zugriffsmodus ist unzulässig.
  • kAccessorFailure (= 7) — Accessor-Nutzung oder -Erzeugung fehlgeschlagen.
  • kEventInvalidOperation (= 8) — unzulässige Event-Operation.
  • kFeatureNotSupported (= 9) — Feature wird nicht unterstützt.
  • kInvalidIndex (= 10) — Index ist ungültig.
  • kInvalidParameter (= 11) — ungültiger API-Parameter.
  • kInvalidObject (= 12) — ungültiges oder zerstörtes Objekt verwendet.
  • kTimedOut (= 13) — Operation überschritt die Zeitgrenze.

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

Record
AUTOSAR/AP/record/AP_SWS_SHWA_01301
Status
valid/unmigrated
Version
AUTOSAR/AP/record/AP_SWS_SHWA_01301@rel:R25-11#cfa33aae
Content hash
cfa33aae
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_SafeHardwareAcceleration.pdf#nameddest=AP_SWS_SHWA_01301
Status: valid/unmigrated Version: rel:R25-11#cfa33aae 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_01301@rel:R25-11#cfa33aae
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

Documentation of free functions

function GetShwaDomain [AP_SWS_SHWA_01311] Upstream: RS_AP_00119, RS_AP_00120, RS_AP_00159

constexpr const ara::core::ErrorDomain & GetShwaDomain () noexcept;

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

Thread Safetythread-safe
Exception Safetyexception safe

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

Record
AUTOSAR/AP/record/AP_SWS_SHWA_01311
Status
valid/unmigrated
Version
AUTOSAR/AP/record/AP_SWS_SHWA_01311@rel:R25-11#733e648e
Content hash
733e648e
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_SafeHardwareAcceleration.pdf#nameddest=AP_SWS_SHWA_01311
Status: valid/unmigrated Version: rel:R25-11#733e648e 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_01311@rel:R25-11#733e648e
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 MakeErrorCode [AP_SWS_SHWA_01312] Upstream: RS_AP_00119, RS_AP_00120, RS_AP_00121, RS_AP_00135

constexpr ara::core::ErrorCode MakeErrorCode (ShwaErrorCode code, ara::core::ErrorDomain::SupportDataType data) noexcept;

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

Thread Safetythread-safe
Exception Safetyexception safe

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

Record
AUTOSAR/AP/record/AP_SWS_SHWA_01312
Status
valid/unmigrated
Version
AUTOSAR/AP/record/AP_SWS_SHWA_01312@rel:R25-11#a5d8ab39
Content hash
a5d8ab39
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_SafeHardwareAcceleration.pdf#nameddest=AP_SWS_SHWA_01312
Status: valid/unmigrated Version: rel:R25-11#a5d8ab39 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_01312@rel:R25-11#a5d8ab39
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