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 402 of file qureg.cpp.
402 {
403 validate_quregFields(qureg, __func__);
404
405
406 if (qureg.isGpuAccelerated)
407 gpu_copyGpuToCpu(qureg);
408}
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 395 of file qureg.cpp.
395 {
396 validate_quregFields(qureg, __func__);
397
398
399 if (qureg.isGpuAccelerated)
400 gpu_copyCpuToGpu(qureg);
401}
◆ 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 430 of file qureg.cpp.
430 {
431 validate_quregFields(qureg, __func__);
432 validate_localAmpIndices(qureg, localStartInd, numLocalAmps, __func__);
433
434
435
436
437
438
439
440
441
442 if (!qureg.isGpuAccelerated)
443 return;
444
445
446
447 gpu_copyGpuToCpu(&qureg.gpuAmps[localStartInd], &qureg.cpuAmps[localStartInd], numLocalAmps);
448}
◆ 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 411 of file qureg.cpp.
411 {
412 validate_quregFields(qureg, __func__);
413 validate_localAmpIndices(qureg, localStartInd, numLocalAmps, __func__);
414
415
416
417
418
419
420
421
422
423 if (!qureg.isGpuAccelerated)
424 return;
425
426
427
428 gpu_copyCpuToGpu(&qureg.cpuAmps[localStartInd], &qureg.gpuAmps[localStartInd], numLocalAmps);
429}