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

Function accel_statevec_setAmps_sub

quest/src/core/accelerator.cpp:205–217  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

203
204
205void accel_statevec_setAmps_sub(qcomp* inAmps, Qureg qureg, qindex localStartInd, qindex numLocalAmps) {
206
207 // in CPU settings, we use memory-copying rather than OpenMP
208 // loop updating, because the latter is only faster when carefully
209 // optimising parallelisation granularity with the memory
210 // architecture, which we cannot reliably do in a platform
211 // agnostic way (except via hwloc or something)
212
213 // copy directly from inAmps to GPU/CPU
214 (qureg.isGpuAccelerated)?
215 gpu_copyCpuToGpu(inAmps, &qureg.gpuAmps[localStartInd], numLocalAmps): // (src, dest) = (cpu, gpu)
216 cpu_copyArray( &qureg.cpuAmps[localStartInd], inAmps, numLocalAmps); // (dest, src)
217}
218
219
220void accel_densmatr_setAmpsToPauliStrSum_sub(Qureg qureg, PauliStrSum sum) {

Callers 1

Calls 2

gpu_copyCpuToGpuFunction · 0.85
cpu_copyArrayFunction · 0.85

Tested by

no test coverage detected