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

Function unload_cuda_cn

src/core/impl/comp_node_api.cpp:49–57  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

47}
48
49void unload_cuda_cn(mgbComputeNode_t cn) {
50 auto* device = reinterpret_cast<mgb::CompNode*>(cn);
51 auto& cache = cn_cache();
52 mgb_assert(
53 cache.find(device->to_string_physical()) != cache.end() &&
54 device == cache[device->to_string_physical()]);
55 cache.erase(device->to_string_physical());
56 delete device;
57}
58
59void* get_cuda_stream(mgbComputeNode_t device) {
60 void* rst = nullptr;

Callers

nothing calls this directly

Calls 4

to_string_physicalMethod · 0.80
findMethod · 0.45
endMethod · 0.45
eraseMethod · 0.45

Tested by

no test coverage detected