TransferAsync
产品支持情况
|
产品 |
是否支持 |
|---|---|
|
|
√ |
|
|
√ |
|
|
x |
|
|
x |
|
|
x |
说明:针对
函数功能
与远端HIXL进行批量异步内存传输。
函数原型
1 2 3 4 5 |
Status TransferAsync(const AscendString &remote_engine, TransferOp operation, const std::vector<TransferOpDesc> &op_descs, const TransferArgs &optional_args, TransferReq &req) |
参数说明
|
参数名称 |
输入/输出 |
取值说明 |
|---|---|---|
|
remote_engine |
输入 |
远端HIXL的唯一标识。 |
|
operation |
输入 |
将远端内存读到本地或者将本地内存写到远端。 |
|
op_descs |
输入 |
批量操作的本地以及远端地址。 |
|
optional_args |
输入 |
可选参数(预留)。 |
|
req |
输出 |
请求的句柄,用于查询传输请求状态。 |
调用示例
//初始化客户端和服务端engine,并完成链接 client_engine.TransferAsync(remote_engine, operation, op_descs, optional_args, req);
返回值
- SUCCESS:成功
- NOT_CONNECTED:没有与对端创建链接
- RESOURCE_EXHAUSTED:资源耗尽
- 其他:失败
约束说明
- 调用该接口之前,需要先调用Connect接口完成与对端的建链。
- 该接口需要和Initialize运行在同一个线程上,如需切换线程调用该接口,需要在Initialize所在线程调用“aclrtGetCurrentContext”获取context,并在新线程调用“aclrtSetCurrentContext”设置context。
- 当前异步传输只支持直传,暂不支持中转传输,默认直传。
父主题: HIXL接口