SkePU  1.2
 All Classes Namespaces Files Functions Variables Enumerations Friends Macros Groups Pages
Public Member Functions | List of all members
skepu::Reduce< ReduceFunc, ReduceFunc > Class Template Reference

A specilalization of above class, used for 1D Reduce operation. Please note that the class name is same. The only difference is how you instantiate it either by passing 1 user function (i.e. 1D reduction) or 2 user function (i.e. 2D reduction). See code examples for more information. More...

#include <reduce.h>

Public Member Functions

 Reduce (ReduceFunc *reduceFunc)
 
 ~Reduce ()
 
template<typename T >
operator() (Vector< T > &input)
 
template<typename T >
operator() (Matrix< T > &input)
 
template<typename T >
operator() (SparseMatrix< T > &input)
 
template<typename T >
Vector< T > operator() (Matrix< T > &input, ReducePolicy reducePolicy)
 
template<typename T >
Vector< T > operator() (SparseMatrix< T > &input, ReducePolicy reducePolicy)
 
template<typename InputIterator >
InputIterator::value_type operator() (InputIterator inputBegin, InputIterator inputEnd)
 
template<typename T >
CPU (Vector< T > &input)
 
template<typename T >
CPU (Matrix< T > &input)
 
template<typename T >
CPU (SparseMatrix< T > &input)
 
template<typename T >
Vector< T > CPU (Matrix< T > &input, ReducePolicy reducePolicy)
 
template<typename T >
Vector< T > CPU (SparseMatrix< T > &input, ReducePolicy reducePolicy)
 
template<typename InputIterator >
InputIterator::value_type CPU (InputIterator inputBegin, InputIterator inputEnd)
 
template<typename T >
OMP (Vector< T > &input)
 
template<typename T >
OMP (Matrix< T > &input)
 
template<typename T >
OMP (SparseMatrix< T > &input)
 
template<typename InputIterator >
InputIterator::value_type OMP (InputIterator inputBegin, InputIterator inputEnd)
 
template<typename T >
CU (Vector< T > &input, int useNumGPU=1)
 
template<typename T >
CU (Matrix< T > &input, int useNumGPU=1)
 
template<typename T >
CU (SparseMatrix< T > &input, int useNumGPU=1)
 
template<typename InputIterator >
InputIterator::value_type CU (InputIterator inputBegin, InputIterator inputEnd, int useNumGPU=1)
 
template<typename T >
CL (Vector< T > &input, int useNumGPU=1)
 
template<typename T >
CL (Matrix< T > &input, int useNumGPU=1)
 
template<typename T >
CL (SparseMatrix< T > &input, int useNumGPU=1)
 
template<typename T >
Vector< T > CL (Matrix< T > &input, ReducePolicy reducePolicy, int useNumGPU=1)
 
template<typename T >
Vector< T > CL (SparseMatrix< T > &input, ReducePolicy reducePolicy, int useNumGPU=1)
 
template<typename InputIterator >
InputIterator::value_type CL (InputIterator inputBegin, InputIterator inputEnd, int useNumGPU=1)
 
template<typename T >
skepu::Vector< T > CU (Matrix< T > &input, ReducePolicy reducePolicy, int useNumGPU)
 
template<typename T >
skepu::Vector< T > CU (SparseMatrix< T > &input, ReducePolicy reducePolicy, int useNumGPU)
 
template<typename T >
skepu::Vector< T > OMP (Matrix< T > &input, ReducePolicy reducePolicy)
 
template<typename T >
skepu::Vector< T > OMP (SparseMatrix< T > &input, ReducePolicy reducePolicy)
 

Detailed Description

template<typename ReduceFunc>
class skepu::Reduce< ReduceFunc, ReduceFunc >

A specilalization of above class, used for 1D Reduce operation. Please note that the class name is same. The only difference is how you instantiate it either by passing 1 user function (i.e. 1D reduction) or 2 user function (i.e. 2D reduction). See code examples for more information.

Constructor & Destructor Documentation

template<typename ReduceFunc >
skepu::Reduce< ReduceFunc, ReduceFunc >::Reduce ( ReduceFunc *  reduceFunc)

When creating an instance of the Reduce skeleton, a pointer to a binary user function must be provided. Also the Environment is set and if SKEPU_OPENCL is defined, the appropriate OpenCL program and kernel are created. Also creates a default execution plan which the skeleton will use if no other is specified.

Parameters
reduceFuncA pointer to a valid binary user function. Will be deleted in the destructor.

References skepu::ExecPlan::calibrated, and skepu::Environment< T >::getInstance().

Here is the call graph for this function:

template<typename ReduceFunc >
skepu::Reduce< ReduceFunc, ReduceFunc >::~Reduce ( )

When the Reduce skeleton is destroyed, it deletes the user function it was created with.

Member Function Documentation

template<typename ReduceFunc >
template<typename T >
T skepu::Reduce< ReduceFunc, ReduceFunc >::CL ( Vector< T > &  input,
int  useNumGPU = 1 
)

Performs the Reduction on a whole Vector. Returns a scalar result. A wrapper for CL(InputIterator inputBegin, InputIterator inputEnd, int useNumGPU). Using OpenCL as backend.

Parameters
inputA vector which the reduction will be performed on.
useNumGPUInteger specifying how many devices to use. 0 = implementation decides.
Returns
The scalar result of the reduction performed.

References skepu::Vector< T >::begin(), skepu::Reduce< ReduceFuncRowWise, ReduceFuncColWise >::CL(), and skepu::Vector< T >::end().

Here is the call graph for this function:

template<typename ReduceFunc >
template<typename T >
T skepu::Reduce< ReduceFunc, ReduceFunc >::CL ( Matrix< T > &  input,
int  useNumGPU = 1 
)

Performs the Reduction on a whole Matrix. Returns a scalar result. A wrapper for CL(InputIterator inputBegin, InputIterator inputEnd, int useNumGPU). Using OpenCL as backend.

Parameters
inputA matrix which the reduction will be performed on.
useNumGPUInteger specifying how many devices to use. 0 = implementation decides.
Returns
The scalar result of the reduction performed.

References skepu::Reduce< ReduceFuncRowWise, ReduceFuncColWise >::CL().

Here is the call graph for this function:

template<typename ReduceFunc >
template<typename T >
T skepu::Reduce< ReduceFunc, ReduceFunc >::CL ( SparseMatrix< T > &  input,
int  useNumGPU = 1 
)

Performs the Reduction on non-zero elements of a SparseMatrix. Returns a scalar result. Using OpenCL as backend.

Parameters
inputA sparse matrix which the reduction will be performed on.
useNumGPUInteger specifying how many devices to use. 0 = implementation decides.
Returns
The scalar result of the reduction performed.

References skepu::DeviceMemPointer_CL< T >::changeDeviceData(), skepu::DeviceMemPointer_CL< T >::copyDeviceToHost(), skepu::SparseMatrix< T >::get_values(), skepu::DeviceMemPointer_CL< T >::getDeviceDataPointer(), skepu::getNumBlocksAndThreads(), MAX_GPU_DEVICES, skepu::printCLError(), skepu::SparseMatrix< T >::total_nnz(), and skepu::SparseMatrix< T >::updateDevice_CL().

Here is the call graph for this function:

template<typename ReduceFunc >
template<typename T >
Vector< T > skepu::Reduce< ReduceFunc, ReduceFunc >::CL ( Matrix< T > &  input,
ReducePolicy  reducePolicy,
int  useNumGPU = 1 
)

Performs the Reduction, either row-wise or column-wise, on a Matrix. Returns a SkePU vector of reduction result. Using OpenCL as backend.

Parameters
inputA matrix which the reduction will be performed on.
reducePolicyThe policy specifying how reduction will be performed, can be either REDUCE_ROW_WISE_ONLY of REDUCE_COL_WISE_ONLY
useNumGPUInteger specifying how many devices to use. 0 = implementation decides.
Returns
A skepu Vector containing reduction results either row-wise or column-wise depending upon supplied ReducePolicy.

References skepu::getNumBlocksAndThreads(), MAX_GPU_DEVICES, and skepu::Matrix< T >::size().

Here is the call graph for this function:

template<typename ReduceFunc >
template<typename T >
Vector< T > skepu::Reduce< ReduceFunc, ReduceFunc >::CL ( SparseMatrix< T > &  input,
ReducePolicy  reducePolicy,
int  useNumGPU = 1 
)

Performs the Reduction on a whole SparseMatrix. Returns a SkePU vector of reduction result. Using OpenCL as backend.

Parameters
inputA sparse matrix which the reduction will be performed on.
reducePolicyThe policy specifying how reduction will be performed, can be either REDUCE_ROW_WISE_ONLY of REDUCE_COL_WISE_ONLY
useNumGPUInteger specifying how many devices to use. 0 = implementation decides.
Returns
A skepu Vector containing reduction results either row-wise or column-wise depending upon supplied ReducePolicy.

References skepu::SparseMatrix< T >::begin(), skepu::SparseMatrix< T >::get_values(), skepu::DeviceMemPointer_CL< T >::getDeviceDataPointer(), skepu::getNumBlocksAndThreads(), MAX_GPU_DEVICES, skepu::SparseMatrix< T >::total_nnz(), skepu::SparseMatrix< T >::total_rows(), and skepu::SparseMatrix< T >::updateDevice_CL().

Here is the call graph for this function:

template<typename ReduceFunc >
template<typename InputIterator >
InputIterator::value_type skepu::Reduce< ReduceFunc, ReduceFunc >::CL ( InputIterator  inputBegin,
InputIterator  inputEnd,
int  useNumGPU = 1 
)

Performs the Reduction on a range of elements. Returns a scalar result. The function decides whether to perform the reduction on one device, calling reduceSingle_CL(InputIterator inputBegin, InputIterator inputEnd, unsigned int deviceID) or on multiple devices, calling reduceNumDevices_CL(InputIterator inputBegin, InputIterator inputEnd, size_t numDevices). Using OpenCL as backend.

Parameters
inputBeginAn iterator to the first element in the range.
inputEndAn iterator to the last element of the range.
useNumGPUInteger specifying how many devices to use. 0 = implementation decides.
Returns
The scalar result of the reduction performed.

References skepu::DeviceMemPointer_CL< T >::getDeviceDataPointer(), skepu::getNumBlocksAndThreads(), MAX_GPU_DEVICES, and skepu::printCLError().

Here is the call graph for this function:

template<typename ReduceFunc >
template<typename T >
T skepu::Reduce< ReduceFunc, ReduceFunc >::CPU ( Vector< T > &  input)

Performs the Reduction on a whole Vector. Returns a scalar result. A wrapper for CPU(InputIterator inputBegin, InputIterator inputEnd). Using the CPU as backend.

Parameters
inputA vector which the reduction will be performed on.
Returns
The scalar result of the reduction performed.

References skepu::Vector< T >::begin(), skepu::Reduce< ReduceFuncRowWise, ReduceFuncColWise >::CPU(), and skepu::Vector< T >::end().

Here is the call graph for this function:

template<typename ReduceFunc >
template<typename T >
T skepu::Reduce< ReduceFunc, ReduceFunc >::CPU ( Matrix< T > &  input)

Performs the Reduction on a whole Matrix. Returns a scalar result. A wrapper for CPU(InputIterator inputBegin, InputIterator inputEnd). Using the CPU as backend.

Parameters
inputA matrix which the reduction will be performed on.
Returns
The scalar result of the reduction performed.

References skepu::Reduce< ReduceFuncRowWise, ReduceFuncColWise >::CPU().

Here is the call graph for this function:

template<typename ReduceFunc >
template<typename T >
T skepu::Reduce< ReduceFunc, ReduceFunc >::CPU ( SparseMatrix< T > &  input)

Performs the Reduction on non-zero elements of a SparseMatrix. Returns a scalar result. Using the CPU as backend.

Parameters
inputA sparse matrix which the reduction will be performed on.
Returns
The scalar result of the reduction performed.

References skepu::SparseMatrix< T >::get_values(), skepu::SparseMatrix< T >::total_nnz(), and skepu::SparseMatrix< T >::updateHost().

Here is the call graph for this function:

template<typename ReduceFunc >
template<typename T >
Vector< T > skepu::Reduce< ReduceFunc, ReduceFunc >::CPU ( Matrix< T > &  input,
ReducePolicy  reducePolicy 
)

Performs the Reduction on a whole Matrix either row-wise or column-wise. Returns a SkePU vector of reduction result. Using the CPU as backend.

Parameters
inputA matrix which the reduction will be performed on.
reducePolicyThe policy specifying how reduction will be performed, can be either REDUCE_ROW_WISE_ONLY of REDUCE_COL_WISE_ONLY
Returns
A skepu Vector containing reduction results either row-wise or column-wise depending upon supplied ReducePolicy.
template<typename ReduceFunc >
template<typename T >
Vector< T > skepu::Reduce< ReduceFunc, ReduceFunc >::CPU ( SparseMatrix< T > &  input,
ReducePolicy  reducePolicy 
)

Performs the Reduction on non-zero elements of a SparseMatrix either row-wise or column-wise. Returns a vector of reduction result. Using the CPU as backend.

Parameters
inputA matrix which the reduction will be performed on.
reducePolicyThe policy specifying how reduction will be performed, can be either REDUCE_ROW_WISE_ONLY of REDUCE_COL_WISE_ONLY
Returns
A skepu Vector containing reduction results either row-wise or column-wise depending upon supplied ReducePolicy.

References skepu::SparseMatrix< T >::begin(), skepu::SparseMatrix< T >::total_cols(), skepu::SparseMatrix< T >::total_nnz(), skepu::SparseMatrix< T >::total_rows(), and skepu::SparseMatrix< T >::updateHost().

Here is the call graph for this function:

template<typename ReduceFunc >
template<typename InputIterator >
InputIterator::value_type skepu::Reduce< ReduceFunc, ReduceFunc >::CPU ( InputIterator  inputBegin,
InputIterator  inputEnd 
)

Performs the Reduction on a range of elements. Returns a scalar result. Does the reduction on the CPU by iterating over all elements in the range.

Parameters
inputBeginAn iterator to the first element in the range.
inputEndAn iterator to the last element of the range.
Returns
The scalar result of the reduction performed.
template<typename ReduceFunc >
template<typename T >
T skepu::Reduce< ReduceFunc, ReduceFunc >::CU ( Vector< T > &  input,
int  useNumGPU = 1 
)

Performs the Reduction on a whole Vector. Returns a scalar result. A wrapper for CU(InputIterator inputBegin, InputIterator inputEnd, int useNumGPU). Using CUDA as backend.

Parameters
inputA vector which the reduction will be performed on.
useNumGPUInteger specifying how many devices to use. 0 = implementation decides.
Returns
The scalar result of the reduction performed.

References skepu::Vector< T >::begin(), skepu::Reduce< ReduceFuncRowWise, ReduceFuncColWise >::CU(), and skepu::Vector< T >::end().

Here is the call graph for this function:

template<typename ReduceFunc >
template<typename T >
T skepu::Reduce< ReduceFunc, ReduceFunc >::CU ( Matrix< T > &  input,
int  useNumGPU = 1 
)

Performs the Reduction on a whole Matrix. Returns a scalar result. A wrapper for CU(InputIterator inputBegin, InputIterator inputEnd, int useNumGPU). Using CUDA as backend.

Parameters
inputA matrix which the reduction will be performed on.
useNumGPUInteger specifying how many devices to use. 0 = implementation decides.
Returns
The scalar result of the reduction performed.

References skepu::Reduce< ReduceFuncRowWise, ReduceFuncColWise >::CU().

Here is the call graph for this function:

template<typename ReduceFunc >
template<typename T >
T skepu::Reduce< ReduceFunc, ReduceFunc >::CU ( SparseMatrix< T > &  input,
int  useNumGPU = 1 
)

Performs the Reduction on non-zero elements of a SparseMatrix. Returns a scalar result. The function decides whether to perform the reduction on one device, calling reduceSingleThread_CU(SparseMatrix<T> &input, int deviceID) or on multiple devices, dividing the range of elements equally among the participating devices each reducing its part. The results are then reduced themselves on the CPU. Using CUDA as backend.

Parameters
inputA sparse matrix which the reduction will be performed on.
useNumGPUInteger specifying how many devices to use. 0 = implementation decides.
Returns
The scalar result of the reduction performed.

References skepu::DeviceMemPointer_CU< T >::changeDeviceData(), skepu::DeviceMemPointer_CU< T >::copyDeviceToHost(), skepu::SparseMatrix< T >::get_values(), skepu::DeviceMemPointer_CU< T >::getDeviceDataPointer(), skepu::getNumBlocksAndThreads(), MAX_GPU_DEVICES, skepu::SparseMatrix< T >::total_nnz(), and skepu::SparseMatrix< T >::updateDevice_CU().

Here is the call graph for this function:

template<typename ReduceFunc >
template<typename InputIterator >
InputIterator::value_type skepu::Reduce< ReduceFunc, ReduceFunc >::CU ( InputIterator  inputBegin,
InputIterator  inputEnd,
int  useNumGPU = 1 
)

Performs the Reduction on a range of elements. Returns a scalar result. The function decides whether to perform the reduction on one device, calling reduceSingleThread_CU(InputIterator inputBegin, InputIterator inputEnd, int deviceID) or on multiple devices, dividing the range of elements equally among the participating devices each reducing its part. The results are then reduced themselves on the CPU.

Parameters
inputBeginAn iterator to the first element in the range.
inputEndAn iterator to the last element of the range.
useNumGPUInteger specifying how many devices to use. 0 = implementation decides.
Returns
The scalar result of the reduction performed.

References skepu::getNumBlocksAndThreads(), and MAX_GPU_DEVICES.

Here is the call graph for this function:

template<typename ReduceFunc >
template<typename T >
skepu::Vector<T> skepu::Reduce< ReduceFunc, ReduceFunc >::CU ( Matrix< T > &  input,
ReducePolicy  reducePolicy,
int  useNumGPU 
)

Performs the Reduction on a whole Matrix either row-wise or column-wise. Returns a SkePU vector of reduction result. Using CUDA as backend.

Parameters
inputA matrix which the reduction will be performed on.
reducePolicyThe policy specifying how reduction will be performed, can be either REDUCE_ROW_WISE_ONLY of REDUCE_COL_WISE_ONLY
useNumGPUInteger specifying how many devices to use. 0 = implementation decides.
Returns
A skepu Vector containing reduction results either row-wise or column-wise depending upon supplied ReducePolicy.

References skepu::Device_CU::getNoConcurrentKernels(), skepu::getNumBlocksAndThreads(), and MAX_GPU_DEVICES.

Here is the call graph for this function:

template<typename ReduceFunc >
template<typename T >
skepu::Vector<T> skepu::Reduce< ReduceFunc, ReduceFunc >::CU ( SparseMatrix< T > &  input,
ReducePolicy  reducePolicy,
int  useNumGPU 
)

Performs the Reduction, either row-wise or column-wise, on non-zero elements of a SparseMatrix. Returns a SkePU vector of reduction result. Using CUDA as backend.

Parameters
inputA sparse matrix which the reduction will be performed on.
reducePolicyThe policy specifying how reduction will be performed, can be either REDUCE_ROW_WISE_ONLY of REDUCE_COL_WISE_ONLY
useNumGPUInteger specifying how many devices to use. 0 = implementation decides.
Returns
A skepu Vector containing reduction results either row-wise or column-wise depending upon supplied ReducePolicy.

References skepu::SparseMatrix< T >::begin(), skepu::SparseMatrix< T >::get_values(), skepu::DeviceMemPointer_CU< T >::getDeviceDataPointer(), skepu::Device_CU::getNoConcurrentKernels(), skepu::getNumBlocksAndThreads(), MAX_GPU_DEVICES, skepu::SparseMatrix< T >::total_nnz(), skepu::SparseMatrix< T >::total_rows(), and skepu::SparseMatrix< T >::updateDevice_CU().

Here is the call graph for this function:

template<typename ReduceFunc >
template<typename T >
skepu::Vector<T> skepu::Reduce< ReduceFunc, ReduceFunc >::OMP ( Matrix< T > &  input,
ReducePolicy  reducePolicy 
)

Performs the Reduction on a whole Matrix. Returns a SkePU vector of reduction result. Using OpenMP as backend.

Parameters
inputA matrix which the reduction will be performed on.
reducePolicyThe policy specifying how reduction will be performed, can be either REDUCE_ROW_WISE_ONLY of REDUCE_COL_WISE_ONLY
Returns
A skepu Vector containing reduction results either row-wise or column-wise depending upon supplied ReducePolicy.
template<typename ReduceFunc >
template<typename T >
skepu::Vector<T> skepu::Reduce< ReduceFunc, ReduceFunc >::OMP ( SparseMatrix< T > &  input,
ReducePolicy  reducePolicy 
)

Performs the Reduction on non-zero elements of a SparseMatrix. Returns a SkePU vector of reduction result. Using OpenMP as backend. Can apply two different algorithms depending upon whether the workload is regular or irregular across different rows.

Parameters
inputA matrix which the reduction will be performed on.
reducePolicyThe policy specifying how reduction will be performed, can be either REDUCE_ROW_WISE_ONLY of REDUCE_COL_WISE_ONLY
Returns
A skepu Vector containing reduction results either row-wise or column-wise depending upon supplied ReducePolicy.

References skepu::SparseMatrix< T >::total_nnz(), skepu::SparseMatrix< T >::total_rows(), and skepu::SparseMatrix< T >::updateHost().

Here is the call graph for this function:

template<typename ReduceFunc >
template<typename T >
T skepu::Reduce< ReduceFunc, ReduceFunc >::OMP ( Vector< T > &  input)

Performs the Reduction on a whole Vector. Returns a scalar result. A wrapper for OMP(InputIterator inputBegin, InputIterator inputEnd). Using OpenMP as backend.

Parameters
inputA vector which the reduction will be performed on.
Returns
The scalar result of the reduction performed.

References skepu::Vector< T >::begin(), skepu::Vector< T >::end(), and skepu::Reduce< ReduceFuncRowWise, ReduceFuncColWise >::OMP().

Here is the call graph for this function:

template<typename ReduceFunc >
template<typename T >
T skepu::Reduce< ReduceFunc, ReduceFunc >::OMP ( Matrix< T > &  input)

Performs the Reduction on a whole Matrix. Returns a scalar result. A wrapper for OMP(InputIterator inputBegin, InputIterator inputEnd). Using OpenMP as backend.

Parameters
inputA matrix which the reduction will be performed on.
Returns
The scalar result of the reduction performed.

References skepu::Reduce< ReduceFuncRowWise, ReduceFuncColWise >::OMP().

Here is the call graph for this function:

template<typename ReduceFunc >
template<typename T >
T skepu::Reduce< ReduceFunc, ReduceFunc >::OMP ( SparseMatrix< T > &  input)

Performs the Reduction on non-zero elements of a SparseMatrix. Returns a scalar result. Using OpenMP as backend.

Parameters
inputA sparse matrix which the reduction will be performed on.
Returns
The scalar result of the reduction performed.

References skepu::SparseMatrix< T >::get_values(), skepu::SparseMatrix< T >::total_nnz(), and skepu::SparseMatrix< T >::updateHost().

Here is the call graph for this function:

template<typename ReduceFunc >
template<typename InputIterator >
InputIterator::value_type skepu::Reduce< ReduceFunc, ReduceFunc >::OMP ( InputIterator  inputBegin,
InputIterator  inputEnd 
)

Performs the Reduction on a range of elements. Returns a scalar result. Divides the elements among all OpenMP threads and does reduction of the parts in parallel. The results from each thread are then reduced on the CPU.

Parameters
inputBeginAn iterator to the first element in the range.
inputEndAn iterator to the last element of the range.
Returns
The scalar result of the reduction performed.
template<typename ReduceFunc >
template<typename T >
T skepu::Reduce< ReduceFunc, ReduceFunc >::operator() ( Vector< T > &  input)

Performs the Reduction on a Vector. Returns a scalar result.

Depending on which backend was used, different versions of the skeleton is called. If SKEPU_CUDA is defined, the CUDA backend is used, similarly if SKEPU_OPENCL or SKEPU_OPENMP are defined then the OpenCL or OpenMP backend is used. As a fallback there is always a CPU version.

Parameters
inputA vector which the reduction will be performed on.
Returns
The scalar result of the reduction performed.

References skepu::ExecPlan::calibrated, skepu::Reduce< ReduceFuncRowWise, ReduceFuncColWise >::CL(), skepu::Reduce< ReduceFuncRowWise, ReduceFuncColWise >::CPU(), skepu::Reduce< ReduceFuncRowWise, ReduceFuncColWise >::CU(), skepu::Vector< T >::isModified_CU(), skepu::Vector< T >::isVectorOnDevice_CU(), skepu::Reduce< ReduceFuncRowWise, ReduceFuncColWise >::OMP(), and skepu::Vector< T >::size().

Here is the call graph for this function:

template<typename ReduceFunc >
template<typename T >
T skepu::Reduce< ReduceFunc, ReduceFunc >::operator() ( Matrix< T > &  input)

Performs the Reduction on a Matrix. Returns a scalar result.

Depending on which backend was used, different versions of the skeleton is called. If SKEPU_CUDA is defined, the CUDA backend is used, similarly if SKEPU_OPENCL or SKEPU_OPENMP are defined then the OpenCL or OpenMP backend is used. As a fallback there is always a CPU version.

Parameters
inputA matrix which the reduction will be performed on.
Returns
The scalar result of the reduction performed.

References skepu::ExecPlan::calibrated, skepu::Reduce< ReduceFuncRowWise, ReduceFuncColWise >::CL(), skepu::Reduce< ReduceFuncRowWise, ReduceFuncColWise >::CPU(), skepu::Reduce< ReduceFuncRowWise, ReduceFuncColWise >::CU(), and skepu::Reduce< ReduceFuncRowWise, ReduceFuncColWise >::OMP().

Here is the call graph for this function:

template<typename ReduceFunc >
template<typename T >
T skepu::Reduce< ReduceFunc, ReduceFunc >::operator() ( SparseMatrix< T > &  input)

Performs the Reduction on non-zero elements of a SparseMatrix. Returns a scalar result.

Depending on which backend was used, different versions of the skeleton is called. If SKEPU_CUDA is defined, the CUDA backend is used, similarly if SKEPU_OPENCL or SKEPU_OPENMP are defined then the OpenCL or OpenMP backend is used. As a fallback there is always a CPU version.

Parameters
inputA sparse matrix which the reduction will be performed on.
Returns
The scalar result of the reduction performed.

References skepu::ExecPlan::calibrated, skepu::Reduce< ReduceFuncRowWise, ReduceFuncColWise >::CL(), skepu::Reduce< ReduceFuncRowWise, ReduceFuncColWise >::CPU(), skepu::Reduce< ReduceFuncRowWise, ReduceFuncColWise >::CU(), skepu::SparseMatrix< T >::isModified_CU(), skepu::SparseMatrix< T >::isSparseMatrixOnDevice_CU(), skepu::Reduce< ReduceFuncRowWise, ReduceFuncColWise >::OMP(), and skepu::SparseMatrix< T >::total_nnz().

Here is the call graph for this function:

template<typename ReduceFunc >
template<typename T >
Vector< T > skepu::Reduce< ReduceFunc, ReduceFunc >::operator() ( Matrix< T > &  input,
ReducePolicy  reducePolicy 
)

Performs the Reduction on a Matrix either row or column-wise. Returns a skepu Vector containing reduction results either row-wise or column-wise depending upon supplied ReducePolicy.

Depending on which backend was used, different versions of the skeleton is called. If SKEPU_CUDA is defined, the CUDA backend is used, similarly if SKEPU_OPENCL or SKEPU_OPENMP are defined then the OpenCL or OpenMP backend is used. As a fallback there is always a CPU version.

Parameters
inputA matrix which the reduction will be performed on.
reducePolicyThe policy specifying how reduction will be performed, can be either REDUCE_ROW_WISE_ONLY of REDUCE_COL_WISE_ONLY
Returns
A skepu Vector containing reduction results either row-wise or column-wise depending upon supplied ReducePolicy.

References skepu::ExecPlan::calibrated, skepu::Reduce< ReduceFuncRowWise, ReduceFuncColWise >::CL(), skepu::Reduce< ReduceFuncRowWise, ReduceFuncColWise >::CPU(), skepu::Reduce< ReduceFuncRowWise, ReduceFuncColWise >::CU(), and skepu::Reduce< ReduceFuncRowWise, ReduceFuncColWise >::OMP().

Here is the call graph for this function:

template<typename ReduceFunc >
template<typename T >
Vector< T > skepu::Reduce< ReduceFunc, ReduceFunc >::operator() ( SparseMatrix< T > &  input,
ReducePolicy  reducePolicy 
)

Performs the Reduction on non-zero elements of a sparse Matrix either row or column-wise. Returns a skepu Vector containing reduction results either row-wise or column-wise depending upon supplied ReducePolicy.

Depending on which backend was used, different versions of the skeleton is called. If SKEPU_CUDA is defined, the CUDA backend is used, similarly if SKEPU_OPENCL or SKEPU_OPENMP are defined then the OpenCL or OpenMP backend is used. As a fallback there is always a CPU version.

Parameters
inputA sparse matrix which the reduction will be performed on.
reducePolicyThe policy specifying how reduction will be performed, can be either REDUCE_ROW_WISE_ONLY of REDUCE_COL_WISE_ONLY
Returns
A skepu Vector containing reduction results either row-wise or column-wise depending upon supplied ReducePolicy.

References skepu::ExecPlan::calibrated, skepu::Reduce< ReduceFuncRowWise, ReduceFuncColWise >::CL(), skepu::Reduce< ReduceFuncRowWise, ReduceFuncColWise >::CPU(), skepu::Reduce< ReduceFuncRowWise, ReduceFuncColWise >::CU(), skepu::SparseMatrix< T >::isModified_CU(), skepu::SparseMatrix< T >::isSparseMatrixOnDevice_CU(), skepu::Reduce< ReduceFuncRowWise, ReduceFuncColWise >::OMP(), and skepu::SparseMatrix< T >::total_nnz().

Here is the call graph for this function:

template<typename ReduceFunc >
template<typename InputIterator >
InputIterator::value_type skepu::Reduce< ReduceFunc, ReduceFunc >::operator() ( InputIterator  inputBegin,
InputIterator  inputEnd 
)

Performs the Reduction on a range of elements. Returns a scalar result.

Depending on which backend was used, different versions of the skeleton is called. If SKEPU_CUDA is defined, the CUDA backend is used, similarly if SKEPU_OPENCL or SKEPU_OPENMP are defined then the OpenCL or OpenMP backend is used. As a fallback there is always a CPU version.

Parameters
inputBeginAn iterator to the first element in the range.
inputEndAn iterator to the last element of the range.
Returns
The scalar result of the reduction performed.

References skepu::Reduce< ReduceFuncRowWise, ReduceFuncColWise >::CL(), skepu::Reduce< ReduceFuncRowWise, ReduceFuncColWise >::CPU(), skepu::Reduce< ReduceFuncRowWise, ReduceFuncColWise >::CU(), and skepu::Reduce< ReduceFuncRowWise, ReduceFuncColWise >::OMP().

Here is the call graph for this function:


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