Core item ComputeModel. More...
#include <NeComputeModel.h>
Public Member Functions | |
ComputeModel () | |
Default constructor. More... | |
ComputeModel (unsigned int inNumThreads) | |
Constructor. More... | |
Public Attributes | |
unsigned int | numThreads |
Core item ComputeModel.
<note> The ComputeModel class allows you to select the type of hardware to use in your computational algorithms.
If your computational algorithm requires the GPU, set 'inEngine' to the object that will execute the compute shaders. If your algorithm requires CPU multithreading, set the 'inNumThreads' to the desired number of threads, presumably 2 or larger. You can query for the number of concurrent hardware threads using std::thread::hardware_concurrency(). If you want single-threaded computations (on the main thread), set inNumThreads to 1. An example of using this class is
ComputeModel cmodel(...); if (cmodel.engine) { ComputeUsingGPU(...); } else if (cmodel.numThreads > 1) { ComputeUsingCPUMultipleThreads(); } else { ComputeUsingCPUSingleThread(); } See GenerateMeshUV<Real>::SolveSystem(...) for a concrete example.
Of course, your algorithm can interpret cmodel anyway it likes. For example, you might ignore cmodel.engine if all you care about is multithreading on the CPU. </note>
Hmetal T, 04.08.2016.
Definition at line 71 of file NeComputeModel.h.
|
inlinevirtual |
Definition at line 75 of file NeComputeModel.h.
|
inline |
Default constructor.
<note> You may derive from this class to make additional behavior available to your algorithms. For example, you might add a callback function to report progress of the algorithm. </note>
Hmetal T, 04.08.2016.
Definition at line 90 of file NeComputeModel.h.
|
inline |
Constructor.
<note> You may derive from this class to make additional behavior available to your algorithms. For example, you might add a callback function to report progress of the algorithm. </note>
Hmetal T, 04.08.2016.
inNumThreads | The in number threads. |
Definition at line 107 of file NeComputeModel.h.
unsigned int NeuralEngine::ComputeModel::numThreads |
Definition at line 118 of file NeComputeModel.h.