Function: value_wait

Applicability

Product

Supported (√/x)

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

Function Usage

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)
    

Parameter Description

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 values are as follows:

ACL_VALUE_WAIT_GEQ = 0x0;    # Waits until (int64_t) (*devAddr- value) >= 0.
ACL_VALUE_WAIT_EQ = 0x1;    # Waits until *devAddr == value.
ACL_VALUE_WAIT_AND = 0x2;   # Waits until (*devAddr & value) != 0.
ACL_VALUE_WAIT_NOR = 0x3;   # Waits until ~(*devAddr | value) != 0.

stream

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

Return Value Description

Return Value

Description

ret

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