---
title: 函数：value_write
description: "| 产品 | 是否支持 |"
url: https://www.hiascend.com/document/detail/zh/canncommercial/latest/API/runtimeapi/aclpythondevg_01_1068.html
sourcePath: /source/zh/canncommercial/900/API/runtimeapi/aclpythondevg_01_1068.html
indexId: f181d2d6152d7d5b0de92804fc69b47d032e68a2a6b4655843d513e948c1d2d471
---
# 函数：value_write

#### 产品支持情况

| 产品 | 是否支持 |
| --- | --- |
| Atlas 350 加速卡 | √ |
| Atlas A3 训练系列产品 / Atlas A3 推理系列产品 | √ |
| Atlas A2 训练系列产品 / Atlas A2 推理系列产品 | √ |
| Atlas 训练系列产品 | √ |
| Atlas 推理系列产品 | x |
| Atlas 200I/500 A2 推理产品 | x |


#### 功能说明

向指定内存中写数据。


#### 函数原型

- C函数原型

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


- python函数
  1 ret = acl.rt.value_write(dev_addr, value, flag, stream)


#### 参数说明

| 参数名 | 说明 |
| --- | --- |
| dev\_addr | int，Device侧内存地址。 此处需用户提前申请Device内存（例如调用acl.rt.malloc接口），dev\_addr要求8字节对齐，有效内存位宽为64bit。 |
| value | int，需向内存中写入的数据。 |
| flag | int，预留参数，当前固定设置为0。 |
| stream | int，指定stream。此处支持传0，表示使用默认Stream。 |


#### 返回值说明

| 返回值 | 说明 |
| --- | --- |
| ret | int，错误码，返回0表示成功，返回其它值表示失败。 |
