aclrtCacheLastTaskOpInfo

Applicability

Product

Supported

Atlas A3 training products/Atlas A3 inference products

Atlas A2 training products/Atlas A2 inference products

Atlas 200I/500 A2 inference products

Atlas inference products

Atlas training products

Description

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

Prototype

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; else, failure. For details, see aclError.

API Call Sequence

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 task capture.
  8. After performance data collection is enabled (by calling the APIs in Profiling Data Collection 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 operator cache information is also released.