MCPcopy Create free account
hub / github.com/QuEST-Kit/QuEST / chooseWhetherToGpuAccelQureg

Function chooseWhetherToGpuAccelQureg

quest/src/core/autodeployer.cpp:90–106  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

88
89
90void 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
109void chooseWhetherToMultithreadQureg(int numQubits, int isDensMatr, int &useMultithread, int numQuregNodes) {

Callers 1

Tested by

no test coverage detected