Unlock

Applicability

Product

Supported

Atlas 350 Accelerator Card

Atlas A3 training product/Atlas A3 inference product

x

Atlas A2 training product/Atlas A2 inference product

x

Atlas 200I/500 A2 inference product

x

Atlas inference product AI Core

x

Atlas inference product Vector Core

x

Atlas training product

x

Function Usage

Releases the mutex based on MutexID after the current pipeline instruction preceding the unlock exits.

Prototype

1
2
template <pipe_t pipe>
static __aicore__ inline void Unlock(MutexID id)

Parameters

Table 1 Template parameters

Parameter

Description

pipe

Template parameter, indicating the type of a pipeline.

For details about supported pipelines, see Pipelines.

Table 2 Parameters

Parameter

Input/Output

Description

id

Input

Mutex ID for pipeline synchronization management.

The ID can be custom (ranging from 0 to 27) or released using AllocMutexID/ReleaseMutexID.

Returns

None

Constraints

  • When using lock and unlock operations and using custom mutex ID, do not use related APIs in TQue, TQueBind, and TBufPool at the same time.
  • For the same mutex ID, the lock and unlock operations must be used together, and the specified pipes must be the same. This means operations on other pipelines can be performed only after the lock and unlock operations on a pipeline are complete.
  • In scenarios where data dependency exists between the same pipelines, you are advised to use the PipeBarrier API.

Example

For details, see Example.