MCPcopy Create free account
hub / github.com/MegEngine/MegCC / exec

Method exec

compiler/test/kernel/common/src/cc_proxy.cpp:400–421  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

398
399template <typename Opr>
400PerformanceResult CCOprProxy<Opr>::exec(
401 Opr* opr, const TensorNDArray& tensors, KernelGen::Arch arch,
402 const BenchmarkOption& benchmark_option, const std::string& kernel_symbol,
403 const std::unordered_map<std::string, CCAttr>& proxy_attr, bool gen_dynamic) {
404 std::unordered_map<std::string, CCAttr> attr_map;
405 auto kernels = opr_fill_attr<Opr>(attr_map, opr, tensors, arch, proxy_attr);
406 auto output_idx = get_output_idx(opr);
407 output_idx.normalize((int)tensors.size());
408 fill_operands(attr_map, tensors, output_idx, gen_dynamic);
409 CodeGenContext ctx(attr_map);
410 MGB_MARK_USED_VAR(call_kernel);
411 MGB_MARK_USED_VAR(gen_kernel);
412#if MEGCC_TEST_GEN
413 gen_kernel(kernels, &ctx, arch, kernel_symbol, gen_dynamic);
414 return {};
415#else
416 //! call kernel
417 return call_kernel(
418 kernels, &ctx, tensors, benchmark_option, kernel_symbol, output_idx,
419 gen_dynamic);
420#endif
421}
422
423#undef FILL_MAP
424#undef FILL_MAP_EX

Callers

nothing calls this directly

Calls 4

fill_operandsFunction · 0.85
call_kernelFunction · 0.85
normalizeMethod · 0.80
gen_kernelFunction · 0.70

Tested by

no test coverage detected