BuildKernelRunContext
Function Usage
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
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.
Constraints
None
Example
auto kernelContextHolder = context_ascendc::ContextBuilder().Inputs().Outputs().BuildKernelRunContext(); gert::KernelContext* tilingParseContext = kernelContextHolder->GetContext<gert::KernelContext>();
Parent topic: ContextBuilder