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 416 of file qureg.cpp.
416 {
417 validate_quregFields(qureg, __func__);
418
419
420 if (qureg.isGpuAccelerated)
421 gpu_copyGpuToCpu(qureg);
422}
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 409 of file qureg.cpp.
409 {
410 validate_quregFields(qureg, __func__);
411
412
413 if (qureg.isGpuAccelerated)
414 gpu_copyCpuToGpu(qureg);
415}
◆ 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 444 of file qureg.cpp.
444 {
445 validate_quregFields(qureg, __func__);
446 validate_localAmpIndices(qureg, localStartInd, numLocalAmps, __func__);
447
448
449
450
451
452
453
454
455
456 if (!qureg.isGpuAccelerated)
457 return;
458
459
460
461 gpu_copyGpuToCpu(&qureg.gpuAmps[localStartInd], &qureg.cpuAmps[localStartInd], numLocalAmps);
462}
◆ 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 425 of file qureg.cpp.
425 {
426 validate_quregFields(qureg, __func__);
427 validate_localAmpIndices(qureg, localStartInd, numLocalAmps, __func__);
428
429
430
431
432
433
434
435
436
437 if (!qureg.isGpuAccelerated)
438 return;
439
440
441
442 gpu_copyCpuToGpu(&qureg.cpuAmps[localStartInd], &qureg.gpuAmps[localStartInd], numLocalAmps);
443}