昇腾社区首页
中文
注册

atb/operation_infra.h

定义

class OperationInfra : public Operation {
public:
    OperationInfra();
    OperationInfra(const OperationInfra &other);
    OperationInfra& operator = (const OperationInfra &other);
    ~OperationInfra();
    void SetExecuteStreamId(uint32_t streamId);
    uint32_t GetExecuteStreamId() const;
    aclrtStream GetExecuteStream(Context *context);
private:
    std::unique_ptr<OperationImpl> impl_;
};

参数列表

成员名称

参数

返回值

描述

OperationInfra

-

-

构造函数。

OperationInfra

other

-

拷贝构造函数。

  • other:拷贝的对象。

operator =

other

OperationInfra&

赋值构造函数。

  • other:赋值的对象。

如果执行成功,返回对象本身。

~OperationInfra

-

-

析构函数。

SetExecuteStreamId

streamId

-

设置该Operation需要使用的stream的id,id为context中的stream序号,该接口需要配合GetExecuteStream接口使用。

  • streamId:需要设置的stream的id。

GetExecuteStreamId

-

uint32_t

获取当前Operation使用的stream的id。

如果执行成功,返回stream的id,id为context中的stream序号。

GetExecuteStream

context

aclrtStream

获取当前Operation使用的stream。

  • context:Operation使用的Context。

如果执行成功,返回当前Operation使用的stream。