DEENESPTFRRUARHIKOZHNL

class ara::shwa::TaskHandler

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_01201] wording not yet imported Upstream: RS_SHWA_00001

class TaskHandler final {...};

Die Spezifikation definiert diesen Klassentyp mit der gezeigten Schnittstelle.

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

User GuideAI-GENERATED

Enables the creation and submission of individual as well as parallel computational tasks to accelerator devices.
AI-GENERATED unreviewed Model: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: 6d7c7c77c2a9 Provenance Open questions (2)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original

Enables the creation and submission of individual as well as parallel computational tasks to accelerator devices.

The class ara::shwa::TaskHandler serves to execute tasks on accelerator hardware via queue submissions [AP_SWS_SHWA_01203]. New instances are created thread-safely via the static factory method Create(), which returns errors in ara::core::Result [AP_SWS_SHWA_01202]. Via SingleTask as well as ParallelFor, individual or data-parallel computational steps can be transmitted to the target device. While instantiation is thread-safe, task submissions are not thread-safe and require external synchronization in the case of concurrent access.

Context

The class ara::shwa::TaskHandler is part of the module for hardware acceleration (final) as a final class (shwa) within the AUTOSAR Adaptive Platform. It acts as the central interface for transmitting and executing computational tasks on a selected target device (Device). Within the software architecture, the class assumes the mediator role between the utilizing software component and the underlying execution infrastructure.

Interaction primarily takes place between two system partners: the calling application and the selected hardware accelerator or its task queue. Computational operations defined on the application side are accepted via the interfaces of ara::shwa::TaskHandler and forwarded to the device as queue submissions [AP_SWS_SHWA_01203]. This enables both the processing of individual computational steps and data-parallel processing patterns [AP_SWS_SHWA_01204]. Interpretation: The class is likely to encapsulate the device-specific queues, allowing application components to drive accelerator resources without being coupled to hardware-near details. Question (open)

Lifecycle

The lifecycle of an instance of ara::shwa::TaskHandler is controlled via a strict factory pattern. Instantiation occurs exclusively via the static factory method Create() [AP_SWS_SHWA_01202]. Because the class is declared as final, specialization via inheritance is precluded. The created object is returned wrapped in a ara::core::Result<TaskHandler>, requiring the success of initialization to be explicitly verified [AP_SWS_SHWA_01202].

Regarding concurrency and thread safety, the class exhibits differentiated properties:

  • Instantiation: Invoking the static method Create() is thread-safe (thread-safe) [AP_SWS_SHWA_01202]. Multiple threads can thus concurrently create new handler instances via the factory path.
  • Task submission: The methods for transmitting work tasks, SingleTask [AP_SWS_SHWA_01203] and ParallelFor [AP_SWS_SHWA_01204], are explicitly specified as not thread-safe (not thread-safe). Consequently, a single instance of TaskHandler must not be accessed uncoordinatedly from multiple threads simultaneously; synchronization is the responsibility of the caller.
  • Exception safety: All methods of the interface are declared as noexcept and guarantee exception safety (exception safe) [AP_SWS_SHWA_01202], [AP_SWS_SHWA_01203], [AP_SWS_SHWA_01204]. For Create(), rollback semantics (rollback_semantics) also apply if initialization fails [AP_SWS_SHWA_01202].

Ownership remains with the utilizing component, which holds and destroys the instance once no further queue submissions are required.

Usage Path

The typical flow is divided into the phases of creation, job configuration, and task transmission. First, the application requests a new instance via ara::shwa::TaskHandler::Create() [AP_SWS_SHWA_01202]. After successful validation of the ara::core::Result, the object is ready for work tasks.

Subsequently, the application decides on the appropriate transmission method based on the processing pattern:

  • For individual computational tasks, SingleTask(cfg) is called, which queues the task function passed as a parameter into the queue of the selected target device [AP_SWS_SHWA_01203].
  • For data-parallel processing patterns, the function template ParallelFor(bufferSize, cfg) is available [AP_SWS_SHWA_01204]. In this case, in addition to the configuration, the buffer size (bufferSize) is passed to control parallel execution across multiple data elements on the accelerator device.

Interpretation: The template parameter T is likely to represent a callable function, a lambda, or a corresponding task configuration that encapsulates the computational logic to be executed on the device. Question Q-2fca8604440b44e9 (open)

Sequence of task submission with TaskHandlerApplicationTaskHandlerDevice-QueueUse Case: InstanziierungCreate()ara::core::Result<TaskHandler>Use Case: Task executionaltEinzelne AufgabeSingleTask(cfg)Queue-EinreichungParallele SchleifeParallelFor(bufferSize, cfg)Queue-Einreichung (Parallel)

Sequence diagram: Interaction chain from instantiation to task submission into the device queue. Sources: [AP_SWS_SHWA_01202], [AP_SWS_SHWA_01203], [AP_SWS_SHWA_01204]

Error Scenarios

Error handling in ara::shwa::TaskHandler follows the exceptionless paradigm (noexcept) of the Adaptive Platform.

Error states occur primarily during instantiation:

  • The factory method Create() reports failures via the error channel in the return value ara::core::Result [AP_SWS_SHWA_01202].
  • As a concrete error identifier, ShwaErrorCode::kRuntime is defined, signaling general runtime errors during object creation [AP_SWS_SHWA_01202]. The specified rollback semantics ensure that no partially initialized states or resource leaks occur in the event of a failure [AP_SWS_SHWA_01202].

The calls SingleTask [AP_SWS_SHWA_01203] and ParallelFor [AP_SWS_SHWA_01204] provide no return value (void) and throw no exceptions. Callers must therefore ensure that the handler instance is valid and that accesses with concurrent threads are externally synchronized.

This text was generated by an AI based on the AUTOSAR specification R25-11.

Member map

Detail view

Select an entry in the outline.

Methods

Create function

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

static ara::core::Result< TaskHandler > Create () noexcept;
ParallelFor function

Führt die übergebene Task-Funktion innerhalb einer Queue-Einreichung auf dem ausgewählten Device aus.

template <typename T> void ParallelFor (std::size_t bufferSize, T cfg) noexcept;
SingleTask function

Führt die übergebene Task-Funktion innerhalb einer Queue-Einreichung auf dem ausgewählten Device aus.

template <typename T> void SingleTask (T cfg) noexcept;

Details

function Create [AP_SWS_SHWA_01202] Upstream: RS_SHWA_00001, RS_SHWA_00007

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

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

Scopeclass ara::shwa::TaskHandler
Thread Safetythread-safe rollback_semantics
Exception Safetyexception safe
ErrorsShwaErrorCode::k Runtime General runtime error

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

Record
AUTOSAR/AP/record/AP_SWS_SHWA_01202
Status
valid/unmigrated
Version
AUTOSAR/AP/record/AP_SWS_SHWA_01202@rel:R25-11#a001527a
Content hash
a001527a
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_SafeHardwareAcceleration.pdf#nameddest=AP_SWS_SHWA_01202
Status: valid/unmigrated Version: rel:R25-11#a001527a 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_01202@rel:R25-11#a001527a
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 ParallelFor [AP_SWS_SHWA_01204] Upstream: RS_SHWA_00001

template <typename T> void ParallelFor (std::size_t bufferSize, T cfg) noexcept;

Führt die übergebene Task-Funktion innerhalb einer Queue-Einreichung auf dem ausgewählten Device aus.

Scopeclass ara::shwa::TaskHandler
Thread Safetynot thread-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_01204
Status
valid/unmigrated
Version
AUTOSAR/AP/record/AP_SWS_SHWA_01204@rel:R25-11#1ff0ddef
Content hash
1ff0ddef
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_SafeHardwareAcceleration.pdf#nameddest=AP_SWS_SHWA_01204
Status: valid/unmigrated Version: rel:R25-11#1ff0ddef 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_01204@rel:R25-11#1ff0ddef
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 SingleTask [AP_SWS_SHWA_01203] Upstream: RS_SHWA_00001

template <typename T> void SingleTask (T cfg) noexcept;

Führt die übergebene Task-Funktion innerhalb einer Queue-Einreichung auf dem ausgewählten Device aus.

Scopeclass ara::shwa::TaskHandler
Thread Safetynot thread-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_01203
Status
valid/unmigrated
Version
AUTOSAR/AP/record/AP_SWS_SHWA_01203@rel:R25-11#2c1013ce
Content hash
2c1013ce
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_SafeHardwareAcceleration.pdf#nameddest=AP_SWS_SHWA_01203
Status: valid/unmigrated Version: rel:R25-11#2c1013ce 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_01203@rel:R25-11#2c1013ce
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