| 33 | |
| 34 | |
| 35 | void 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 | |
| 51 | void freeKrausMap(KrausMap map) { |
no test coverage detected