| 203 | |
| 204 | |
| 205 | void 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 | |
| 220 | void accel_densmatr_setAmpsToPauliStrSum_sub(Qureg qureg, PauliStrSum sum) { |
no test coverage detected