Defined in qengine_opencl.hpp.

The API is provided by Qrack::QInterface, via Qrack::Engine. However, QEngineOCL has a custom constructor:

Qrack::QEngineOCL::QEngineOCL(bitLenInt qBitCount, bitCapInt initState, qrack_rand_gen_ptr rgp = nullptr, complex phaseFac = CMPLX_DEFAULT_ARG, bool doNorm = false, bool randomGlobalPhase = true, bool useHostMem = false, int64_t devID = -1, bool useHardwareRNG = true, bool ignored = false, real1_f norm_thresh = REAL1_EPSILON, std::vector<int64_t> ignored2 = {}, bitLenInt ignored4 = 0U, real1_f ignored3 = FP_NORM_EPSILON_F)

Initialize a Qrack::QEngineOCL object.

Specify the number of qubits and an initial permutation state. Additionally, optionally specify a pointer to a random generator engine object, a device ID from the list of devices in the OCLEngine singleton, and a boolean that is set to “true” to initialize the state vector of the object to zero norm.

“devID” is the index of an OpenCL device in the OCLEngine singleton, to select the device to run this engine on. If “useHostMem” is set false, as by default, the QEngineOCL will attempt to allocate the state vector object only on device memory. If “useHostMem” is set true, general host RAM will be used for the state vector buffers. If the state vector is too large to allocate only on device memory, the QEngineOCL will attempt to fall back to allocating it in general host RAM.

”useHostMem” is not conscious of allocation by other QEngineOCL instances on the same device. Attempting to allocate too much device memory across too many QEngineOCL instances, for which each instance would have sufficient device resources on its own, will probably cause the program to crash (and may lead to general system instability). For safety, “useHostMem” can be turned on.