| 1605 | } |
| 1606 | |
| 1607 | void Model::free_experts() { |
| 1608 | each_card(cards, [&](CardW& c) { |
| 1609 | for (void* p : c.expert_mem) ck(cudaFree(p), "free experts"); |
| 1610 | c.expert_mem.clear(); |
| 1611 | c.bytes -= c.expert_bytes; |
| 1612 | c.expert_bytes = 0; |
| 1613 | c.ec = ExpertCache{}; |
| 1614 | c.ec_owner0.clear(); |
| 1615 | c.ec_slot0.clear(); |
| 1616 | for (LayerW& L : c.L) { |
| 1617 | L.gu_e.p = L.down_e.p = nullptr; |
| 1618 | L.gu_e.ep = L.down_e.ep = nullptr; |
| 1619 | } |
| 1620 | }); |
| 1621 | } |
| 1622 | |
| 1623 | // ---------------------------------------------------------------- the holder's tables for a worker |
| 1624 | // Per card what load_card stored (the geometry the constructor sets again): its pointers, the layers, the experts' |