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

Function chooseWhetherToMultithreadQureg

quest/src/core/autodeployer.cpp:109–121  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

107
108
109void 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
124void autodep_chooseQuregDeployment(int numQubits, int isDensMatr, int &useDistrib, int &useGpuAccel, int &useMultithread, QuESTEnv env) {

Callers 1

Tested by

no test coverage detected