MCPcopy Create free account
hub / github.com/ROCm/AMDMIGraphX / main

Function main

test/gpu/kernels/main.cpp:117–146  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

115};
116
117int main(int argc, const char* argv[])
118{
119 test::driver d{};
120 std::unordered_map<std::string, std::shared_ptr<test_suite>> suites;
121 for(auto [name, content] : ::kernel_tests())
122 {
123 auto ts = std::make_shared<test_suite>(name, content);
124 for(auto&& p : ts->test_cases)
125 {
126 auto case_name = p.first;
127 suites[case_name] = ts;
128 test::add_test_case(case_name, [ts, case_name] { ts->run(case_name); });
129 }
130 }
131 d.on_selected_cases = [&](const std::vector<std::string>& cases) {
132 std::unordered_set<std::shared_ptr<test_suite>> run_suites;
133 for(auto&& name : cases)
134 {
135 if(suites.count(name) == 0)
136 continue;
137 run_suites.insert(suites.at(name));
138 }
139 migraphx::par_for(run_suites.size(), 1, [&](auto i) {
140 auto it = run_suites.begin();
141 std::advance(it, i);
142 (*it)->compile();
143 });
144 };
145 d.run(argc, argv);
146}

Callers

nothing calls this directly

Calls 7

par_forFunction · 0.85
atMethod · 0.80
runMethod · 0.45
insertMethod · 0.45
sizeMethod · 0.45
beginMethod · 0.45
compileMethod · 0.45

Tested by

no test coverage detected