Unlock
Applicability
Product |
Supported |
|---|---|
Atlas 350 Accelerator Card |
√ |
x |
|
x |
|
x |
|
x |
|
x |
|
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
Parameter |
Description |
|---|---|
pipe |
Template parameter, indicating the type of a pipeline. For details about supported pipelines, see Pipelines. |
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.
Parent topic: Mutex (ISASI)