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

Function TEST_F

dnn/test/cuda/svd.cpp:11–28  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9using namespace test;
10
11TEST_F(CUDA, SINGULAR_VALUE_DECOMPOSITION) {
12 auto opr_naive = handle_naive()->create_operator<SVDForward>();
13 auto opr_cuda = handle_cuda()->create_operator<SVDForward>();
14 auto testcases = SVDTestcase::make();
15 for (auto& t : testcases) {
16 auto cuda_result = t.run(opr_cuda.get());
17
18 bool old_compute_nv = t.m_param.compute_uv;
19 t.m_param.compute_uv = false;
20 auto naive_result = t.run(opr_naive.get());
21 t.m_param.compute_uv = old_compute_nv;
22
23 MEGDNN_ASSERT_TENSOR_EQ(*naive_result.s, *cuda_result.s);
24 if (t.m_param.compute_uv) {
25 MEGDNN_ASSERT_TENSOR_EQ(*cuda_result.recovered_mat, t.m_mat);
26 }
27 }
28}
29
30// vim: syntax=cpp.doxygen

Callers

nothing calls this directly

Calls 3

makeFunction · 0.50
runMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected