Function: value_write

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

Writes data to the specified memory.

Prototype

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

Parameter Description

Parameter

Description

dev_addr

Int, device memory address.

You need to allocate device memory in advance (for example, by calling acl.rt.malloc). The value of dev_addr must be 8-byte aligned. The valid memory bit width is 64 bits.

value

Int, data to be written to the memory.

flag

Int, reserved; fixed at 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.