27#include <ql/patterns/singleton.hpp>
29#include <boost/thread/shared_mutex.hpp>
37class ComputeFramework;
87 virtual std::pair<std::size_t, bool>
initiateCalculation(
const std::size_t n,
const std::size_t
id = 0,
88 const std::size_t version = 0,
95 const std::size_t
steps) = 0;
98 const std::vector<std::size_t>& args) = 0;
106 virtual std::vector<std::pair<std::string, std::string>>
deviceInfo()
const {
return {}; }
124 const bool allowOverwrite =
false);
virtual ~ComputeContext()
virtual bool supportsDoublePrecision() const
virtual void disposeCalculation(const std::size_t id)=0
virtual void declareOutputVariable(const std::size_t id)=0
virtual std::vector< std::vector< std::size_t > > createInputVariates(const std::size_t dim, const std::size_t steps)=0
virtual void finalizeCalculation(std::vector< double * > &output)=0
virtual std::size_t createInputVariable(double v)=0
virtual std::size_t applyOperation(const std::size_t randomVariableOpCode, const std::vector< std::size_t > &args)=0
virtual std::pair< std::size_t, bool > initiateCalculation(const std::size_t n, const std::size_t id=0, const std::size_t version=0, const Settings settings={})=0
virtual const DebugInfo & debugInfo() const =0
virtual std::size_t createInputVariable(double *v)=0
virtual std::vector< std::pair< std::string, std::string > > deviceInfo() const
virtual void freeVariable(const std::size_t id)=0
std::set< std::string > getAvailableDevices() const
std::vector< ComputeFramework * > frameworks_
void selectContext(const std::string &deviceName)
std::string currentContextDeviceName_
ComputeContext * currentContext_
ComputeContext & context()
virtual ComputeContext * getContext(const std::string &deviceName)=0
virtual std::set< std::string > getAvailableDevices() const =0
virtual ~ComputeFramework()
const std::vector< std::function< ComputeFramework *(void)> > & getAll() const
void add(const std::string &name, std::function< ComputeFramework *(void)> creator, const bool allowOverwrite=false)
ComputeFrameworkRegistry()
std::vector< std::string > names_
boost::shared_mutex mutex_
std::vector< std::function< ComputeFramework *(void)> > creators_
base class for multi path generators
T * createComputeFrameworkCreator()
unsigned long numberOfOperations
unsigned long nanoSecondsProgramBuild
unsigned long nanoSecondsDataCopy
unsigned long nanoSecondsCalculation
QuantExt::SequenceType rngSequenceType
std::size_t regressionOrder
std::vector< Size > steps