atb/operation_infra.h

Description

Defines the OperationInfra class of the ATB. The API class defines the base class of the plugin operators of the ATB. The base class provides some built-in public APIs for users to compile their own plugin operators.

Definition

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
class OperationInfra : public Operation {
public:
    OperationInfra();
    OperationInfra(const OperationInfra &other);
    OperationInfra& operator = (const OperationInfra &other);
    ~OperationInfra() override;
    void SetExecuteStreamId(uint32_t streamId);
    uint32_t GetExecuteStreamId() const;
    aclrtStream GetExecuteStream(Context *context);
private:
    std::unique_ptr<OperationImpl> impl_;
};

Parameters

Member

Parameter

Return Value

Description

OperationInfra

-

-

Constructor.

OperationInfra

other

-

Copy constructor.

  • other: copied object.

operator =

other

OperationInfra&

Assignment constructor.

  • other: assignment object.

If the execution is successful, the object itself is returned.

~OperationInfra

-

-

Destructor.

SetExecuteStreamId

streamId

-

Used to set the ID of the stream used by the operation. The ID is the stream sequence number in the context. This API must be used together with the GetExecuteStream API.

  • streamId: ID of the stream to be set.

GetExecuteStreamId

-

uint32_t

Used to obtains the ID of the stream used by the current operation.

If the execution is successful, the ID of the stream is returned. The ID is the stream sequence number in the context.

GetExecuteStream

context

aclrtStream

Used to obtain the stream used by the current operation.

  • context: context used by the operation.

If the execution is successful, the stream used by the current operation is returned.