Function: value_wait

Applicable Products

Product

Supported (√/x)

Ascend 950PR/Ascend 950DT

√

Atlas A3 training products/Atlas A3 inference products

√

Atlas A2 training products/Atlas A2 inference products

√

Atlas training products

x

Atlas inference products

x

Atlas 200I/500 A2 inference products

x

Description

Unblocks the data in the specified memory when the data meets certain conditions.

Prototype

  • C Prototype
    aclError aclrtValueWait(void* devAddr, uint64_t value, uint32_t flag, aclrtStream stream) 
  • Python Function
    1
    ret = acl.rt.value_wait(devAddr, value, flag, stream)
    

Parameters

Parameter

Description

devAddr

Int, device memory address.

The valid memory bit width of dev_addr is 64 bits.

value

Int, value to be compared with the data in the memory.

flag

Int, comparison mode. The data will be unblocked after the conditions are met. The options are as follows:

ACL_STREAM_WAIT_VALUE_GEQ = 0x0;    # Waits until (int64_t) (*devAddr- value) >= 0.
ACL_STREAM_WAIT_VALUE_EQ = 0x1;    # Waits until *devAddr == value.
ACL_STREAM_WAIT_VALUE_AND = 0x2;   # Waits until (*devAddr & value) != 0.
ACL_STREAM_WAIT_VALUE_NOR = 0x3;   # Waits until ~(*devAddr | value) != 0.

stream

Int, stream. The value 0 can be passed, indicating that the default stream is used.

Return Values

Return Value

Description

ret

Int, error code. 0 on success; else, failure.