MCPcopy Create free account
hub / github.com/MegEngine/MegEngine / TEST_F

Function TEST_F

dnn/test/rocm/sleep.cpp:14–36  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

12#if !(MEGDNN_AARCH64)
13
14TEST_F(ROCM, SLEEP) {
15 auto opr = this->handle_rocm()->create_operator<Sleep>();
16
17 auto run = [&](float time) -> double {
18 opr->param() = {time};
19 hip_check(hipDeviceSynchronize());
20 auto t0 = std::chrono::high_resolution_clock::now();
21 opr->exec();
22 hip_check(hipDeviceSynchronize());
23 auto t1 = std::chrono::high_resolution_clock::now();
24 std::chrono::duration<double> diff = t1 - t0;
25 return diff.count();
26 };
27
28 // warmv7up
29 run(0.01);
30
31 for (auto i : {0.1, 0.3}) {
32 auto get = run(i);
33 ASSERT_GE(get, i);
34 ASSERT_LE(get, i * 2);
35 }
36}
37
38#endif
39

Callers

nothing calls this directly

Calls 5

runFunction · 0.50
handle_rocmMethod · 0.45
paramMethod · 0.45
execMethod · 0.45
countMethod · 0.45

Tested by

no test coverage detected