| 107 | |
| 108 | |
| 109 | void chooseWhetherToMultithreadQureg(int numQubits, int isDensMatr, int &useMultithread, int numQuregNodes) { |
| 110 | |
| 111 | // if the flag is already set (user-given, or inferred from env), don't change it |
| 112 | if (useMultithread != modeflag::USE_AUTO) |
| 113 | return; |
| 114 | |
| 115 | // otherwise, choose to multithread based on Qureg size |
| 116 | int effectiveNumQubits = mem_getEffectiveNumStateVecQubitsPerNode(numQubits, isDensMatr, numQuregNodes); |
| 117 | useMultithread = (effectiveNumQubits >= MIN_NUM_LOCAL_QUBITS_FOR_AUTO_QUREG_MULTITHREADING); |
| 118 | |
| 119 | // note the qureg may be simultaneously GPU-accelerated and so never use its |
| 120 | // multithreaded CPU routines, except in functions which accept multiple Quregs |
| 121 | } |
| 122 | |
| 123 | |
| 124 | void autodep_chooseQuregDeployment(int numQubits, int isDensMatr, int &useDistrib, int &useGpuAccel, int &useMultithread, QuESTEnv env) { |
no test coverage detected