| 429 | gpu_copyCpuToGpu(&qureg.cpuAmps[localStartInd], &qureg.gpuAmps[localStartInd], numLocalAmps); |
| 430 | } |
| 431 | void syncSubQuregFromGpu(Qureg qureg, qindex localStartInd, qindex numLocalAmps) { |
| 432 | validate_quregFields(qureg, __func__); |
| 433 | validate_localAmpIndices(qureg, localStartInd, numLocalAmps, __func__); |
| 434 | |
| 435 | // the above validation communicates for node consensus in |
| 436 | // distributed settings, because params can differ per-node. |
| 437 | // note also this function accepts statevectors AND density |
| 438 | // matrices, because the latter does not need a bespoke |
| 439 | // (row,col) interface, because the user can only access/modify |
| 440 | // local density matrix amps via a flat index anyway! |
| 441 | |
| 442 | // we permit this function to do nothing when not GPU-accelerated |
| 443 | if (!qureg.isGpuAccelerated) |
| 444 | return; |
| 445 | |
| 446 | // otherwise, every node merely copies its local subset, which |
| 447 | // may differ per-node, in an embarrassingly parallel manner |
| 448 | gpu_copyGpuToCpu(&qureg.gpuAmps[localStartInd], &qureg.cpuAmps[localStartInd], numLocalAmps); |
| 449 | } |
| 450 | |
| 451 | |
| 452 | void getQuregAmps(qcomp* outAmps, Qureg qureg, qindex startInd, qindex numAmps) { |
nothing calls this directly
no test coverage detected