SG++-Doxygen-Documentation
sgpp::datadriven::StreamingOCLMultiPlatform::OperationMultiEvalStreamingOCLMultiPlatform< T > Class Template Reference

This class provides an operation for evaluating multiple grid points in the domain and doing least squares data mining. More...

#include <OperationMultiEvalStreamingOCLMultiPlatform.hpp>

Inheritance diagram for sgpp::datadriven::StreamingOCLMultiPlatform::OperationMultiEvalStreamingOCLMultiPlatform< T >:
sgpp::base::OperationMultipleEval

Public Member Functions

double getDuration () override
 
void mult (base::DataVector &alpha, base::DataVector &result) override
 Performs the MultiEval operation \(v:= B^T \alpha\). More...
 
void mult (base::DataVector &alpha, base::DataVector &result, size_t startIndexData, size_t endIndexData) override
 Multiplication of \(B^T\) with vector \(\alpha\). More...
 
void multTranspose (base::DataVector &source, base::DataVector &result) override
 Performs the transposed MultiEval operation \(v':= B v\). More...
 
void multTranspose (base::DataVector &source, base::DataVector &result, size_t startIndexGrid, size_t endIndexGrid) override
 Multiplication of \(B\) with vector \(\alpha\). More...
 
 OperationMultiEvalStreamingOCLMultiPlatform (base::Grid &grid, base::DataMatrix &dataset, std::shared_ptr< base::OCLManagerMultiPlatform > manager, std::shared_ptr< base::OCLOperationConfiguration > parameters)
 Creates a new instance of the OperationMultiEvalStreamingOCLMultiPlatform class. More...
 
void prepare () override
 Creates the internal data structures used by the algorithm. More...
 
 ~OperationMultiEvalStreamingOCLMultiPlatform ()
 Destructor. More...
 
- Public Member Functions inherited from sgpp::base::OperationMultipleEval
void eval (DataVector &alpha, DataVector &result)
 Evaluate multiple datapoints with the specified grid. More...
 
virtual std::string getImplementationName ()
 Name of this implementation of the operation. More...
 
 OperationMultipleEval (sgpp::base::Grid &grid, DataMatrix &dataset)
 Constructor. More...
 
virtual ~OperationMultipleEval ()
 Destructor. More...
 

Protected Attributes

size_t commonDatasetPadding
 
size_t commonGridPadding
 
size_t datasetSizePadded
 
size_t datasetSizeUnpadded
 
std::vector< std::shared_ptr< base::OCLDevice > > devices
 
size_t dims
 
double duration
 
size_t gridSizePadded
 
size_t gridSizeUnpadded
 
std::vector< T > index
 
std::vector< T > kernelDataset
 
std::vector< T > level
 
std::shared_ptr< base::OCLManagerMultiPlatformmanager
 
std::vector< StreamingOCLMultiPlatform::KernelMult< T > > multKernels
 
std::vector< StreamingOCLMultiPlatform::KernelMultTranspose< T > > multTransposeKernels
 
base::SGppStopwatch myTimer
 
std::shared_ptr< base::OCLOperationConfigurationparameters
 
base::DataMatrix preparedDataset
 
std::shared_ptr< base::QueueLoadBalancerOpenMPqueueLoadBalancerMult
 
std::shared_ptr< base::QueueLoadBalancerOpenMPqueueLoadBalancerMultTranspose
 
bool verbose
 
- Protected Attributes inherited from sgpp::base::OperationMultipleEval
DataMatrixdataset
 
Gridgrid
 
bool isPrepared
 

Detailed Description

template<typename T>
class sgpp::datadriven::StreamingOCLMultiPlatform::OperationMultiEvalStreamingOCLMultiPlatform< T >

This class provides an operation for evaluating multiple grid points in the domain and doing least squares data mining.

This algorithmic variant uses the streaming algorithm for evaluation. It uses high performance OpenCL kernels and is well-suited for large irregular datasets and grids. This class manages one OpenCL kernel for each devices configured using the OCLOperationConfiguration. When a operation is called it triggers the device work by using OpenMP and delegating the work to instances of the kernels. Furthermore, this class converts the received grid and dataset into a representation that is suited for the streaming algorithm.

See also
base::OperationMultipleEval
StreamingOCLMultiPlatform::KernelMult
StreamingOCLMultiPlatform::KernelMultTranspose

Constructor & Destructor Documentation

◆ OperationMultiEvalStreamingOCLMultiPlatform()

Creates a new instance of the OperationMultiEvalStreamingOCLMultiPlatform class.

This class should not be created directly, instead the datadriven operator factory should be used or at least the factory method.

See also
createStreamingOCLMultiPlatformConfigured
Parameters
gridThe grid to evaluate
datasetThe datapoints to evaluate
managerThe OpenCL manager that manages OpenCL internels for this kernel
parametersThe configuration of the kernel leading to different compute kernels

References sgpp::datadriven::StreamingOCLMultiPlatform::Configuration::getKernelName(), sgpp::base::DataMatrix::getNcols(), sgpp::base::DataMatrix::getNrows(), sgpp::base::DataMatrix::getSize(), python.statsfileInfo::i, sgpp::datadriven::StreamingOCLMultiPlatform::OperationMultiEvalStreamingOCLMultiPlatform< T >::prepare(), and sgpp::base::DataMatrix::transpose().

◆ ~OperationMultiEvalStreamingOCLMultiPlatform()

Member Function Documentation

◆ getDuration()

template<typename T >
double sgpp::datadriven::StreamingOCLMultiPlatform::OperationMultiEvalStreamingOCLMultiPlatform< T >::getDuration ( )
inlineoverridevirtual

◆ mult() [1/2]

template<typename T >
void sgpp::datadriven::StreamingOCLMultiPlatform::OperationMultiEvalStreamingOCLMultiPlatform< T >::mult ( base::DataVector alpha,
base::DataVector result 
)
inlineoverridevirtual

Performs the MultiEval operation \(v:= B^T \alpha\).

Parameters
alphaThe surpluses of the grid
resultA vector that contains the result in the order of the dataset

Implements sgpp::base::OperationMultipleEval.

◆ mult() [2/2]

template<typename T >
void sgpp::datadriven::StreamingOCLMultiPlatform::OperationMultiEvalStreamingOCLMultiPlatform< T >::mult ( base::DataVector alpha,
base::DataVector result,
size_t  startIndexData,
size_t  endIndexData 
)
inlineoverridevirtual

Multiplication of \(B^T\) with vector \(\alpha\).

This implementation variant produces a partial result passed on the start and end index provided. Not every MultiEval operation implements this method, as it only useful for distributed algorithms.

Parameters
alphavector, to which \(B\) is applied. Typically the coefficient vector
resultthe result vector of the matrix vector multiplication
startIndexDatabegin of the fragment of the dataset to be evaluated
endIndexDataend of the fragment of the dataset to be evaluated
Returns
The results of the evaluation for the specified range of the dataset

Reimplemented from sgpp::base::OperationMultipleEval.

References sgpp::base::DataVector::getSize(), sgpp::datadriven::StreamingOCLMultiPlatform::OperationMultiEvalStreamingOCLMultiPlatform< T >::gridSizePadded, python.statsfileInfo::i, sgpp::datadriven::StreamingOCLMultiPlatform::OperationMultiEvalStreamingOCLMultiPlatform< T >::prepare(), sgpp::base::SGppStopwatch::start(), and sgpp::base::SGppStopwatch::stop().

◆ multTranspose() [1/2]

template<typename T >
void sgpp::datadriven::StreamingOCLMultiPlatform::OperationMultiEvalStreamingOCLMultiPlatform< T >::multTranspose ( base::DataVector source,
base::DataVector result 
)
inlineoverridevirtual

Performs the transposed MultiEval operation \(v':= B v\).

Parameters
sourceThe vector \(v\)
resultThe result of the matrix vector multiplication in the order of grid (of the alpha vector)

Implements sgpp::base::OperationMultipleEval.

◆ multTranspose() [2/2]

template<typename T >
void sgpp::datadriven::StreamingOCLMultiPlatform::OperationMultiEvalStreamingOCLMultiPlatform< T >::multTranspose ( base::DataVector source,
base::DataVector result,
size_t  startIndexGrid,
size_t  endIndexGrid 
)
inlineoverridevirtual

Multiplication of \(B\) with vector \(\alpha\).

This implementation variant produces a partial result passed on the start and end index provided. Not every MultiEval operation implements this method, as it only useful for distributed algorithms.

Parameters
sourcevector, to which \(B^T\) is applied. Typically the coefficient vector
resultthe result vector of the matrix vector multiplication
startIndexGridbegin of the fragment of the grid to apply the operator to
endIndexGridend of the fragment of the grid to be apply the operator to
Returns
The results of the evaluation for the specified range of the dataset

Reimplemented from sgpp::base::OperationMultipleEval.

References sgpp::datadriven::StreamingOCLMultiPlatform::OperationMultiEvalStreamingOCLMultiPlatform< T >::datasetSizePadded, sgpp::base::DataVector::getSize(), python.statsfileInfo::i, sgpp::datadriven::StreamingOCLMultiPlatform::OperationMultiEvalStreamingOCLMultiPlatform< T >::prepare(), sgpp::base::SGppStopwatch::start(), and sgpp::base::SGppStopwatch::stop().

◆ prepare()

template<typename T >
void sgpp::datadriven::StreamingOCLMultiPlatform::OperationMultiEvalStreamingOCLMultiPlatform< T >::prepare ( )
inlineoverridevirtual

Creates the internal data structures used by the algorithm.

Needs to be called every time the grid changes e.g., due to refinement.

Reimplemented from sgpp::base::OperationMultipleEval.

References sgpp::datadriven::StreamingOCLMultiPlatform::OperationMultiEvalStreamingOCLMultiPlatform< T >::commonDatasetPadding, sgpp::datadriven::StreamingOCLMultiPlatform::OperationMultiEvalStreamingOCLMultiPlatform< T >::commonGridPadding, sgpp::base::OperationMultipleEval::dataset, sgpp::datadriven::StreamingOCLMultiPlatform::OperationMultiEvalStreamingOCLMultiPlatform< T >::datasetSizePadded, chess::dim, sgpp::datadriven::StreamingOCLMultiPlatform::OperationMultiEvalStreamingOCLMultiPlatform< T >::dims, sgpp::base::HashGridPoint::get(), sgpp::base::HashGridStorage::getDimension(), sgpp::datadriven::StreamingOCLMultiPlatform::Configuration::getKernelName(), sgpp::base::DataMatrix::getNrows(), sgpp::base::HashGridStorage::getPoint(), sgpp::base::DataMatrix::getRow(), sgpp::base::HashGridStorage::getSize(), sgpp::base::Grid::getStorage(), sgpp::base::OperationMultipleEval::grid, sgpp::datadriven::StreamingOCLMultiPlatform::OperationMultiEvalStreamingOCLMultiPlatform< T >::gridSizePadded, python.statsfileInfo::i, sgpp::datadriven::StreamingOCLMultiPlatform::OperationMultiEvalStreamingOCLMultiPlatform< T >::index, sgpp::base::DataMatrix::resize(), and sgpp::base::DataMatrix::setRow().

Referenced by sgpp::datadriven::StreamingOCLMultiPlatform::OperationMultiEvalStreamingOCLMultiPlatform< T >::mult(), sgpp::datadriven::StreamingOCLMultiPlatform::OperationMultiEvalStreamingOCLMultiPlatform< T >::multTranspose(), and sgpp::datadriven::StreamingOCLMultiPlatform::OperationMultiEvalStreamingOCLMultiPlatform< T >::OperationMultiEvalStreamingOCLMultiPlatform().

Member Data Documentation

◆ commonDatasetPadding

◆ commonGridPadding

◆ datasetSizePadded

◆ datasetSizeUnpadded

template<typename T >
size_t sgpp::datadriven::StreamingOCLMultiPlatform::OperationMultiEvalStreamingOCLMultiPlatform< T >::datasetSizeUnpadded
protected

◆ devices

template<typename T >
std::vector<std::shared_ptr<base::OCLDevice> > sgpp::datadriven::StreamingOCLMultiPlatform::OperationMultiEvalStreamingOCLMultiPlatform< T >::devices
protected

◆ dims

◆ duration

◆ gridSizePadded

◆ gridSizeUnpadded

template<typename T >
size_t sgpp::datadriven::StreamingOCLMultiPlatform::OperationMultiEvalStreamingOCLMultiPlatform< T >::gridSizeUnpadded
protected

◆ index

◆ kernelDataset

template<typename T >
std::vector<T> sgpp::datadriven::StreamingOCLMultiPlatform::OperationMultiEvalStreamingOCLMultiPlatform< T >::kernelDataset
protected

◆ level

template<typename T >
std::vector<T> sgpp::datadriven::StreamingOCLMultiPlatform::OperationMultiEvalStreamingOCLMultiPlatform< T >::level
protected

◆ manager

◆ multKernels

◆ multTransposeKernels

◆ myTimer

◆ parameters

◆ preparedDataset

◆ queueLoadBalancerMult

template<typename T >
std::shared_ptr<base::QueueLoadBalancerOpenMP> sgpp::datadriven::StreamingOCLMultiPlatform::OperationMultiEvalStreamingOCLMultiPlatform< T >::queueLoadBalancerMult
protected

◆ queueLoadBalancerMultTranspose

template<typename T >
std::shared_ptr<base::QueueLoadBalancerOpenMP> sgpp::datadriven::StreamingOCLMultiPlatform::OperationMultiEvalStreamingOCLMultiPlatform< T >::queueLoadBalancerMultTranspose
protected

◆ verbose


The documentation for this class was generated from the following file: