aclrtCacheLastTaskOpInfo

Applicability

Product

Supported

Atlas 350 Accelerator Card

Atlas A3 training product/Atlas A3 inference product

Atlas A2 training product/Atlas A2 inference product

Atlas 200I/500 A2 inference product

X

Atlas inference product

Atlas training product

X

Description

Caches the operator information in the specified memory to the last delivered task in the current thread based on infoSize when a model running instance is built in the capture mode.

Prototype

1
aclError aclrtCacheLastTaskOpInfo(const void * const infoPtr, const size_t infoSize)

Parameters

Parameter

Input/Output

Description

infoPtr

Input

Pointer to the memory address of the cached information (host memory).

infoSize

Input

Size of the memory for caching information, in bytes. The value range is (0, 64K].

Returns

0 on success; otherwise, failure. For details, see aclError.

API Calling Process

This API must be used together with the following key APIs to specify whether to include operator information when collecting performance data:

  1. Call aclmdlRICaptureBegin to start the capture task.
  2. Call aclrtSetStreamAttribute to enable operator information caching.
  3. Deliver an operator execution task, for example, by calling aclrtLaunchKernelWithConfig.
  4. Call aclrtGetStreamAttribute to check whether operator information caching is enabled.

    Only when operator information caching is enabled (by calling aclrtSetStreamAttribute) in the capture state, the aclrtGetStreamAttribute API can be used to obtain the status of the operator information caching function and the operator information can be cached.

  5. Call aclrtCacheLastTaskOpInfo to cache the operator information.
  6. Call aclrtSetStreamAttribute again to disable operator information caching.
  7. Call aclmdlRICaptureEnd to end the capture task.
  8. After performance data collection is enabled (by calling the APIs in Data Profiling APIs), call aclmdlRIExecuteAsync to run inference.

    During this process, the collected performance data contains operator information.

  9. Finally, when aclmdlRIDestroy is called to destroy the model running instance, the cached operator information is also released.