SG++
sgpp::datadriven::StreamingOCLMultiPlatform::KernelMult< T > Class Template Reference

Kernel that provide the MultiEval \(v:= B^T \alpha\) operation for a single OpenCL device. More...

#include <KernelMult.hpp>

Public Member Functions

double getBuildDuration ()
 
 KernelMult (std::shared_ptr< base::OCLDevice > device, size_t dims, std::shared_ptr< base::OCLManagerMultiPlatform > manager, json::Node &kernelConfiguration, std::shared_ptr< base::QueueLoadBalancerOpenMP > queueBalancerMult)
 Constructs a new KernelMult object. More...
 
double mult (std::vector< T > &level, std::vector< T > &index, std::vector< T > &dataset, std::vector< T > &alpha, std::vector< T > &result, const size_t start_index_grid, const size_t end_index_grid, const size_t start_index_data, const size_t end_index_data)
 Perform the MultiEval operator with the device this kernel manages. More...
 
 ~KernelMult ()
 Destructor. More...
 

Detailed Description

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

Kernel that provide the MultiEval \(v:= B^T \alpha\) operation for a single OpenCL device.

This class manages the OpenCL data structures required for a OpenCL kernel invocation. To that end, it makes heavy use of OpenCL buffer abstraction. It makes use of a queue of work packages to find out whether still device has any remaining work available. For the creation of the device-side compute kernel code, a code generator is used.

See also
base::OCLBufferWrapperSD
base::QueueLoadBalancer
SourceBuilderMultTranspose

Constructor & Destructor Documentation

template<typename T>
sgpp::datadriven::StreamingOCLMultiPlatform::KernelMult< T >::KernelMult ( std::shared_ptr< base::OCLDevice device,
size_t  dims,
std::shared_ptr< base::OCLManagerMultiPlatform manager,
json::Node kernelConfiguration,
std::shared_ptr< base::QueueLoadBalancerOpenMP queueBalancerMult 
)
inline

Constructs a new KernelMult object.

Parameters
deviceThe OpenCL device this kernel instance manages
dimsDimensionality of the problem
managerThe OpenCL manager to reduce OpenCL boilerplate
kernelConfigurationThe configuration of this specific device
queueBalancerMultLoad balance for query work from for the device

References json::Node::getBool(), and json::Node::getUInt().

Destructor.

Member Function Documentation

template<typename T>
double sgpp::datadriven::StreamingOCLMultiPlatform::KernelMult< T >::getBuildDuration ( )
inline
Returns
The time it took to compile the OpenCL kernel code

References alpha, dataset, sgpp::base::OCLBufferWrapperSD< T >::intializeTo(), and level.

template<typename T>
double sgpp::datadriven::StreamingOCLMultiPlatform::KernelMult< T >::mult ( std::vector< T > &  level,
std::vector< T > &  index,
std::vector< T > &  dataset,
std::vector< T > &  alpha,
std::vector< T > &  result,
const size_t  start_index_grid,
const size_t  end_index_grid,
const size_t  start_index_data,
const size_t  end_index_data 
)
inline

Perform the MultiEval operator with the device this kernel manages.

Has additional, currently unused parameters to enable further MPI parallelization in the future.

Parameters
levelVector containing the d-dimensional levels of the grid, the order matches the index vector
indexVector containing the d-dimensional indices of the grid, the order matches the level vector
datasetVector containing the d-dimensional data points
alphaVector containing the surpluses, the order matches level and index
resultThe MultiEval results in the order of the data points of the dataset
start_index_gridstart of range of grid points to work on, currently not used
end_index_gridend of range of grid points to work on, currently not used
start_index_datastart of range of data points to work on, currently not used
end_index_dataend of range of data points to work on, currently not used

References sgpp::datadriven::StreamingOCLMultiPlatform::SourceBuilderMult< real_type >::generateSource(), sgpp::base::OCLBufferWrapperSD< T >::getBuffer(), sgpp::base::OCLBufferWrapperSD< T >::getHostPointer(), sgpp::base::OCLBufferWrapperSD< T >::readFromBuffer(), and python.leja::start.


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