MCPcopy Create free account
hub / github.com/QuEST-Kit/QuEST / freeSuperOp

Function freeSuperOp

quest/src/api/channels.cpp:35–48  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

33
34
35void freeSuperOp(SuperOp op) {
36
37 // free CPU memory, even if it is nullptr
38 cpu_deallocArray(op.cpuElemsFlat);
39 cpu_deallocMatrixWrapper(op.cpuElems);
40
41 // free teeniy-tiny heap flag
42 cpu_deallocHeapFlag(op.wasGpuSynced);
43
44 // we avoid invoking a GPU function in non-GPU mode
45 auto gpuPtr = util_getGpuMemPtr(op);
46 if (mem_isAllocated(gpuPtr))
47 gpu_deallocArray(gpuPtr);
48}
49
50
51void freeKrausMap(KrausMap map) {

Callers 3

freeKrausMapFunction · 0.85
freeObjFunction · 0.85
destroySuperOpFunction · 0.85

Calls 6

cpu_deallocArrayFunction · 0.85
cpu_deallocMatrixWrapperFunction · 0.85
cpu_deallocHeapFlagFunction · 0.85
util_getGpuMemPtrFunction · 0.85
mem_isAllocatedFunction · 0.85
gpu_deallocArrayFunction · 0.85

Tested by

no test coverage detected