BuildKernelRunContext

Function

Constructs KernelRunContext and returns the smart pointer to KernelRunContextHolder. The smart pointer's object can be used to obtain the object of the KernelContext type by using the GetContext API.

Prototype

1
std::shared_ptr<KernelRunContextHolder> BuildKernelRunContext()

Parameters

None

Returns

Shared pointer to KernelRunContextHolder. The KernelContext object can be obtained by using the GetContext<gert::KernelContext>() function.

Restrictions

None

Examples

1
2
auto kernelContextHolder = context_ascendc::ContextBuilder().Inputs().Outputs().BuildKernelRunContext();
gert::KernelContext* tilingParseContext = kernelContextHolder->GetContext<gert::KernelContext>();