| 33 | } |
| 34 | |
| 35 | mgbComputeNode_t load_cuda_cn(int device_id, int stream) { |
| 36 | std::string loc = ssprintf("gpu%i:%i", device_id, stream); |
| 37 | mgb_assert(!is_finalize()); |
| 38 | auto& cache = cn_cache(); |
| 39 | if (cache.find(loc) == cache.end()) { |
| 40 | auto* cn = new mgb::CompNode; |
| 41 | (*cn) = mgb::CompNode::load(loc); |
| 42 | mgb_assert(cn->to_string_physical() == loc); |
| 43 | cache[loc] = cn; |
| 44 | cn->activate(); |
| 45 | } |
| 46 | return reinterpret_cast<mgbComputeNode_t>(cache[loc]); |
| 47 | } |
| 48 | |
| 49 | void unload_cuda_cn(mgbComputeNode_t cn) { |
| 50 | auto* device = reinterpret_cast<mgb::CompNode*>(cn); |
nothing calls this directly
no test coverage detected