Skip to content

Commit

Permalink
Add QPager and QHybrid
Browse files Browse the repository at this point in the history
  • Loading branch information
WrathfulSpatula committed Sep 6, 2020
1 parent 65c9b59 commit 0d98c48
Show file tree
Hide file tree
Showing 8 changed files with 37 additions and 5 deletions.
2 changes: 1 addition & 1 deletion docs/api/oclengine.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
:orphan:

.. Copyright (c) 2018
.. Copyright (c) 2017-2020
OCLEngine
========================
Expand Down
2 changes: 1 addition & 1 deletion docs/api/qenginecpu.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
:orphan:

.. Copyright (c) 2018
.. Copyright (c) 2017-2020
QEngineCPU
========================
Expand Down
2 changes: 1 addition & 1 deletion docs/api/qengineocl.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
:orphan:

.. Copyright (c) 2018
.. Copyright (c) 2017-2020
QEngineOCL
========================
Expand Down
16 changes: 16 additions & 0 deletions docs/api/qhybrid.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
:orphan:

.. Copyright (c) 2017-2020
QHybrid
========================

Defined in `qhybrid.hpp <https://github.com/vm6502q/qrack/blob/master/include/qhybrid.hpp>`_.

Qrack::QHybrid switches between QEngineCPU and QEngineOCL as optimal. It may combined with Qrack::QUnit. It supports the standard Qrack::QInterface API.

The parameter "qubitThreshold" is the number of qubits at which QHybrid will automatically switch to GPU operation. A value of "0" will automatically pick this threshold based on best estimates of efficiency.

.. doxygenfunction:: Qrack::QHybrid::QHybrid(bitLenInt qBitCount, bitCapInt initState = 0, qrack_rand_gen_ptr rgp = nullptr, complex phaseFac = CMPLX_DEFAULT_ARG, bool doNorm = true, bool randomGlobalPhase = true, bool useHostMem = false, int deviceId = -1, bool useHardwareRNG = true, bool useSparseStateVec = false, real1 norm_thresh = REAL1_DEFAULT_ARG, std::vector<int> ignored = {}, bitLenInt qubitThreshold = 0)

.. doxygenfunction:: Qrack::QHybrid::SwitchModes
2 changes: 1 addition & 1 deletion docs/api/qinterface.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
:orphan:

.. Copyright (c) 2018
.. Copyright (c) 2017-2020
QInterface
========================
Expand Down
14 changes: 14 additions & 0 deletions docs/api/qpager.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
:orphan:

.. Copyright (c) 2017-2020
QPager
========================

Defined in `qpager.hpp <https://github.com/vm6502q/qrack/blob/master/include/qpager.hpp>`_.

Qrack::QPager "pages" RAM between several QEngineCPU or QEngineOCL instances, by splitting the simulation into equal segments. QEngineOCL device IDs can by individually specified per page with the "devList" parameter. This allows for a different model of multi-device parallelism.

The parameter "qubitThreshold" is the number of qubits in each "page." A value of "0" will automatically size pages based on best estimates of efficiency.

.. doxygenfunction:: Qrack::QPager::QPager(QInterfaceEngine eng, bitLenInt qBitCount, bitCapInt initState = 0, qrack_rand_gen_ptr rgp = nullptr, complex phaseFac = CMPLX_DEFAULT_ARG, bool ignored = false, bool ignored2 = false, bool useHostMem = false, int deviceId = -1, bool useHardwareRNG = true, bool useSparseStateVec = false, real1 ignored3 = REAL1_DEFAULT_ARG, std::vector<int> devList = {}, bitLenInt qubitThreshold = 0);
2 changes: 1 addition & 1 deletion docs/api/qunit.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
:orphan:

.. Copyright (c) 2018
.. Copyright (c) 2017-2020
QUnit
========================
Expand Down
2 changes: 2 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ Daniel Strano would like to specifically note that Benn Bollay is almost entirel
api/oclengine
api/qenginecpu
api/qengineocl
api/qhybrid
api/qpager
api/qunit
api/6502

Expand Down

0 comments on commit 0d98c48

Please sign in to comment.