Functions for copying memory between a Qureg's CPU (RAM) and GPU (VRAM) memory.
More...
Functions for copying memory between a Qureg's CPU (RAM) and GPU (VRAM) memory.
These functions are only necessary when the user wishes to manually probe or modify the Qureg amplitudes (rather than use functions like getQuregAmps() and setQuregAmps()), to ensure that the CPU and GPU copies of the Qureg are identical. These functions have no effect when running without GPU-acceleration, but remain legal and harmless to call, to achieve platform agnosticism.
◆ syncQuregFromGpu()
| void syncQuregFromGpu |
( |
Qureg | qureg | ) |
|
- Note
- Documentation for this function or struct is under construction!
- Warning
- This function has not yet been unit tested and may contain bugs. Please use with caution!
Definition at line 403 of file qureg.cpp.
403 {
404 validate_quregFields(qureg, __func__);
405
406
407 if (qureg.isGpuAccelerated)
408 gpu_copyGpuToCpu(qureg);
409}
Referenced by TEST_CASE(), and TEST_CASE().
◆ syncQuregToGpu()
| void syncQuregToGpu |
( |
Qureg | qureg | ) |
|
- Note
- Documentation for this function or struct is under construction!
- Warning
- This function has not yet been unit tested and may contain bugs. Please use with caution!
Definition at line 396 of file qureg.cpp.
396 {
397 validate_quregFields(qureg, __func__);
398
399
400 if (qureg.isGpuAccelerated)
401 gpu_copyCpuToGpu(qureg);
402}
◆ syncSubQuregFromGpu()
| void syncSubQuregFromGpu |
( |
Qureg | qureg, |
|
|
qindex | localStartInd, |
|
|
qindex | numLocalAmps ) |
- Note
- Documentation for this function or struct is under construction!
- Warning
- This function has not yet been unit tested and may contain bugs. Please use with caution!
Definition at line 431 of file qureg.cpp.
431 {
432 validate_quregFields(qureg, __func__);
433 validate_localAmpIndices(qureg, localStartInd, numLocalAmps, __func__);
434
435
436
437
438
439
440
441
442
443 if (!qureg.isGpuAccelerated)
444 return;
445
446
447
448 gpu_copyGpuToCpu(&qureg.gpuAmps[localStartInd], &qureg.cpuAmps[localStartInd], numLocalAmps);
449}
◆ syncSubQuregToGpu()
| void syncSubQuregToGpu |
( |
Qureg | qureg, |
|
|
qindex | localStartInd, |
|
|
qindex | numLocalAmps ) |
- Note
- Documentation for this function or struct is under construction!
- Warning
- This function has not yet been unit tested and may contain bugs. Please use with caution!
Definition at line 412 of file qureg.cpp.
412 {
413 validate_quregFields(qureg, __func__);
414 validate_localAmpIndices(qureg, localStartInd, numLocalAmps, __func__);
415
416
417
418
419
420
421
422
423
424 if (!qureg.isGpuAccelerated)
425 return;
426
427
428
429 gpu_copyCpuToGpu(&qureg.cpuAmps[localStartInd], &qureg.gpuAmps[localStartInd], numLocalAmps);
430}