MCPcopy Create free account
hub / github.com/Xtra-Computing/thundersvm / ~SyncMem

Method ~SyncMem

src/thundersvm/syncmem.cpp:19–34  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

17 }
18
19 SyncMem::~SyncMem() {
20 if (this->head_ != UNINITIALIZED) {
21 this->head_ = UNINITIALIZED;
22 if (own_host_data || own_device_data) total_memory_size -= size_;
23 if (host_ptr && own_host_data) {
24 free_host(host_ptr);
25 host_ptr = nullptr;
26 }
27#ifdef USE_CUDA
28 if (device_ptr && own_device_data) {
29 CUDA_CHECK(cudaFree(device_ptr));
30 device_ptr = nullptr;
31 }
32#endif
33 }
34 }
35
36 void *SyncMem::host_data() {
37 to_host();

Callers

nothing calls this directly

Calls 1

free_hostFunction · 0.85

Tested by

no test coverage detected