aclrtValueWrite

Applicable Products

Product

Supported

Ascend 950PR / Ascend 950DT

√

Atlas A3 training products / Atlas A3 inference products

√

Atlas A2 training products / Atlas A2 inference products

√

Atlas 200I/500 A2 inference products

☓

Atlas inference products

☓

Atlas training products

☓

Function

Writes data to the specified memory. This is an asynchronous API.

Prototype

1
aclError aclrtValueWrite(void* devAddr, uint64_t value, uint32_t flag, aclrtStream stream)

Parameters

Parameter

Input/Output

Description

devAddr

Input

Memory address on the device.

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

value

Input

Data to be written to the memory.

flag

Input

Reserved. The value is fixed at 0.

stream

Input

Stream for executing the data write task. For details about the type definition, see aclrtStream.

The value NULL is supported, indicating that the default stream is used.

Returns

0 on success; otherwise, failure. For details, see aclError.

API Call Example

For the API call example, see Memory Semantic Synchronization.