| 88 | |
| 89 | |
| 90 | void chooseWhetherToGpuAccelQureg(int numQubits, int isDensMatr, int &useGpuAccel, int numQuregNodes) { |
| 91 | |
| 92 | // if the flag is already set, don't change it |
| 93 | if (useGpuAccel != modeflag::USE_AUTO) |
| 94 | return; |
| 95 | |
| 96 | // determine the 'effective number of qubits' each GPU would have to simulate, if distributed... |
| 97 | int effectiveNumQubits = mem_getEffectiveNumStateVecQubitsPerNode(numQubits, isDensMatr, numQuregNodes); |
| 98 | |
| 99 | // and choose to GPU accelerate only if that's not too few |
| 100 | useGpuAccel = (effectiveNumQubits >= MIN_NUM_LOCAL_QUBITS_FOR_AUTO_QUREG_GPU_ACCELERATION); |
| 101 | |
| 102 | // notice there was no automatic disabling of GPU acceleration in the scenario that the local |
| 103 | // partition exceeded GPU memory. This is because such a scenario would be catastrophically |
| 104 | // slow and astonish users by leaving GPUs idle in intensive simulation. Instead, we auto-deploy |
| 105 | // to GPU anyway and subsequent validation will notice we exceeded GPU memory and report an error. |
| 106 | } |
| 107 | |
| 108 | |
| 109 | void chooseWhetherToMultithreadQureg(int numQubits, int isDensMatr, int &useMultithread, int numQuregNodes) { |
no test coverage detected