简介
ContextBuilder类提供一系列的API接口,支持手动构造TilingContext类来验证Tiling函数以及KernelContext类用于TilingParse函数的验证。
调用示例
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
// 构造KernelContext auto kernelContextHolder = context_ascendc::ContextBuilder(). Inputs(...) .Outputs(...) .BuildKernelRunContext(); gert::KernelContext* tilingParseContext = kernelContextHolder->GetContext<gert::KernelContext>(); // 构造TilingContext auto tilingContextHolder = context_ascendc::ContextBuilder(). .SetOpNameType(...,...) .NodeIoNum(...) .IrInstanceNum(...) .AddInputTd(...) .AddOutputTd(...) .AddAttr(...) .BuildTilingContext(...); gert::TilingContext* tilingContext = tilingContextHolder->GetContext<gert::TilingContext>(); |
父主题: ContextBuilder