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

Function destroyCachedQuregs

tests/utils/cache.cpp:119–139  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

117}
118
119void destroyCachedQuregs() {
120
121 // must not be called twice nor pre-creation
122 DEMAND( ! statevecs1.empty() );
123 DEMAND( ! statevecs2.empty() );
124 DEMAND( ! densmatrs1.empty() );
125 DEMAND( ! densmatrs2.empty() );
126
127 auto caches = {
128 statevecs1, statevecs2,
129 densmatrs1, densmatrs2};
130
131 for (auto& cache : caches)
132 for (auto& [label, qureg]: cache)
133 destroyQureg(qureg);
134
135 statevecs1.clear();
136 statevecs2.clear();
137 densmatrs1.clear();
138 densmatrs2.clear();
139}
140
141quregCache getCachedStatevecs() {
142

Callers 1

mainFunction · 0.85

Calls 1

destroyQuregFunction · 0.85

Tested by

no test coverage detected