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

Function TEST

compiler/test/kernel/opr/generalIntrinsic/benchmark_typecvt.cpp:6–23  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4using namespace megcc::KernelGen;
5#ifdef ENABLE_KERNEL_BENCHMARK
6TEST(GI, BENCHMARK_TYPECVT) {
7 Benchmarker<TypeCvtForward> benchmarker(Arch::BAREMETAL);
8 for (auto kernel_filter : {"GI_kernel_typecvt.+"}) {
9 benchmarker.set_kernel_symbol(kernel_filter);
10 printf("kernel_filter=%s\n", kernel_filter);
11 std::vector<std::pair<megdnn::DType, megdnn::DType>> types = {
12 {dtype::Uint8(), dtype::Float32()},
13 {dtype::QuantizedS8(0.3f), dtype::Float32()},
14 {dtype::Float32(), dtype::QuantizedS8(1.7f)},
15 {dtype::QuantizedS8(1.7f), dtype::QuantizedS8(0.3f)}};
16
17 for (auto type : types) {
18 benchmarker.set_dtype(0, type.first);
19 benchmarker.set_dtype(1, type.second);
20 benchmarker.execs({{1, 16, 1024, 1024}, {1, 16, 1024, 1024}}).print();
21 }
22 }
23}
24#endif

Callers

nothing calls this directly

Calls 2

printMethod · 0.80
execsMethod · 0.45

Tested by

no test coverage detected