Overview

The ContextBuilder class provides a series of APIs for you to manually build the TilingContext class to verify the tiling functions and the KernelContext class to verify the TilingParse functions.

Example

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

// Build TilingContext.
auto tilingContextHolder = context_ascendc::ContextBuilder().
  .SetOpNameType(...,...)
  .NodeIoNum(...)
  .IrInstanceNum(...)
  .AddInputTd(...)
  .AddOutputTd(...)
  .AddAttr(...)
  .BuildTilingContext(...);
gert::TilingContext* tilingContext = tilingContextHolder->GetContext<gert::TilingContext>();