MCPcopy Create free account
hub / github.com/Niko1221/Strata / each_card

Function each_card

engine/src/split/src/model.cpp:1571–1584  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1569namespace {
1570template <typename F>
1571void each_card(std::vector<CardW>& cards, F f) {
1572 std::vector<std::thread> th;
1573 std::vector<std::string> errs(NCARD);
1574 for (int c = 0; c < NCARD; ++c)
1575 th.emplace_back([&, c] {
1576 try {
1577 ck(cudaSetDevice(cards[c].dev), "cudaSetDevice");
1578 f(cards[c]);
1579 } catch (const std::exception& e) { errs[c] = e.what(); }
1580 });
1581 for (auto& t : th) t.join();
1582 for (int c = 0; c < NCARD; ++c)
1583 if (!errs[c].empty()) throw std::runtime_error("card " + std::to_string(c) + ": " + errs[c]);
1584}
1585} // namespace
1586
1587void Model::place_experts() {

Callers 2

place_expertsMethod · 0.85
free_expertsMethod · 0.85

Calls 6

ckFunction · 0.70
cudaSetDeviceFunction · 0.50
fFunction · 0.50
to_stringFunction · 0.50
joinMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected