Overview
ExtendedKernelContext is a subclass of KernelContext. It encapsulates context information processing APIs related to compute nodes based on KernelContext. It provides APIs for accessing the inputs, outputs, attributes, types, and names of compute nodes. This class is used to simplify the process of obtaining and processing compute node information. You can directly obtain the KernelContext information through the ExtendedKernelContext API without knowing the layout of KernelContext. As shown in the following figure, all subclasses except KernelContext do not contain any member variables. Therefore, all classes in this inheritance tree can be used as POD classes and forcibly converted to the original KernelContext. In addition, a subclass is only a wrapper class and does not involve independent construction and destruction scenarios. Therefore, all constructors and destructors of the subclass are disabled.
The following figure shows the inheritance relationship of ExtendedKernelContext.
Header Files to Be Included
1 | #include <extended_kernel_context.h> |
Public Member Functions
const CompileTimeTensorDesc *GetInputDesc(const size_t index) const const CompileTimeTensorDesc *GetOutputDesc(const size_t index) const const CompileTimeTensorDesc *GetOptionalInputDesc(const size_t ir_index) const const CompileTimeTensorDesc *GetDynamicInputDesc(const size_t ir_index, const size_t relative_index) const const CompileTimeTensorDesc *GetRequiredInputDesc(const size_t ir_index) const const AnchorInstanceInfo *GetIrInputInstanceInfo(const size_t ir_index) const const AnchorInstanceInfo *GetIrOutputInstanceInfo(const size_t ir_index) const size_t GetComputeNodeInputNum() const size_t GetComputeNodeOutputNum() const const RuntimeAttrs *GetAttrs() const const ge::char_t *GetNodeType() const const ge::char_t *GetNodeName() const constComputeNodeInfo *GetComputeNodeInfo() const const ge::char_t *GetKernelName() const const ge::char_t *GetKernelType() const const KernelExtendInfo *GetExtendInfo() const