MCPcopy Create free account
hub / github.com/OpenPTrack/open_ptrack_v2 / ~SyncedMemory

Method ~SyncedMemory

rtpose_wrapper/src/caffe/syncedmem.cpp:7–23  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5namespace caffe {
6
7SyncedMemory::~SyncedMemory() {
8 if (cpu_ptr_ && own_cpu_data_) {
9 CaffeFreeHost(cpu_ptr_, cpu_malloc_use_cuda_);
10 }
11
12#ifndef CPU_ONLY
13 if (gpu_ptr_ && own_gpu_data_) {
14 int initial_device;
15 cudaGetDevice(&initial_device);
16 if (gpu_device_ != -1) {
17 CUDA_CHECK(cudaSetDevice(gpu_device_));
18 }
19 CUDA_CHECK(cudaFree(gpu_ptr_));
20 cudaSetDevice(initial_device);
21 }
22#endif // CPU_ONLY
23}
24
25inline void SyncedMemory::to_cpu() {
26 switch (head_) {

Callers

nothing calls this directly

Calls 1

CaffeFreeHostFunction · 0.85

Tested by

no test coverage detected