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 > | |
T | operator() (Vector< T > &input) |
template<typename T > | |
T | operator() (Matrix< T > &input) |
template<typename T > | |
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 > | |
T | CPU (Vector< T > &input) |
template<typename T > | |
T | CPU (Matrix< T > &input) |
template<typename T > | |
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 > | |
T | OMP (Vector< T > &input) |
template<typename T > | |
T | OMP (Matrix< T > &input) |
template<typename T > | |
T | OMP (SparseMatrix< T > &input) |
template<typename InputIterator > | |
InputIterator::value_type | OMP (InputIterator inputBegin, InputIterator inputEnd) |
template<typename T > | |
T | CU (Vector< T > &input, int useNumGPU=1) |
template<typename T > | |
T | CU (Matrix< T > &input, int useNumGPU=1) |
template<typename T > | |
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 > | |
T | CL (Vector< T > &input, int useNumGPU=1) |
template<typename T > | |
T | CL (Matrix< T > &input, int useNumGPU=1) |
template<typename T > | |
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) |
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.
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.
reduceFunc | A pointer to a valid binary user function. Will be deleted in the destructor. |
References skepu::ExecPlan::calibrated, and skepu::Environment< T >::getInstance().
skepu::Reduce< ReduceFunc, ReduceFunc >::~Reduce | ( | ) |
When the Reduce skeleton is destroyed, it deletes the user function it was created with.
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.
input | A vector which the reduction will be performed on. |
useNumGPU | Integer specifying how many devices to use. 0 = implementation decides. |
References skepu::Vector< T >::begin(), skepu::Reduce< ReduceFuncRowWise, ReduceFuncColWise >::CL(), and skepu::Vector< T >::end().
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.
input | A matrix which the reduction will be performed on. |
useNumGPU | Integer specifying how many devices to use. 0 = implementation decides. |
References skepu::Reduce< ReduceFuncRowWise, ReduceFuncColWise >::CL().
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.
input | A sparse matrix which the reduction will be performed on. |
useNumGPU | Integer specifying how many devices to use. 0 = implementation decides. |
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().
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.
input | A matrix which the reduction will be performed on. |
reducePolicy | The policy specifying how reduction will be performed, can be either REDUCE_ROW_WISE_ONLY of REDUCE_COL_WISE_ONLY |
useNumGPU | Integer specifying how many devices to use. 0 = implementation decides. |
References skepu::getNumBlocksAndThreads(), MAX_GPU_DEVICES, and skepu::Matrix< T >::size().
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.
input | A sparse matrix which the reduction will be performed on. |
reducePolicy | The policy specifying how reduction will be performed, can be either REDUCE_ROW_WISE_ONLY of REDUCE_COL_WISE_ONLY |
useNumGPU | Integer specifying how many devices to use. 0 = implementation decides. |
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().
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.
inputBegin | An iterator to the first element in the range. |
inputEnd | An iterator to the last element of the range. |
useNumGPU | Integer specifying how many devices to use. 0 = implementation decides. |
References skepu::DeviceMemPointer_CL< T >::getDeviceDataPointer(), skepu::getNumBlocksAndThreads(), MAX_GPU_DEVICES, and skepu::printCLError().
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.
input | A vector which the reduction will be performed on. |
References skepu::Vector< T >::begin(), skepu::Reduce< ReduceFuncRowWise, ReduceFuncColWise >::CPU(), and skepu::Vector< T >::end().
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.
input | A matrix which the reduction will be performed on. |
References skepu::Reduce< ReduceFuncRowWise, ReduceFuncColWise >::CPU().
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.
input | A sparse matrix which the reduction will be performed on. |
References skepu::SparseMatrix< T >::get_values(), skepu::SparseMatrix< T >::total_nnz(), and skepu::SparseMatrix< T >::updateHost().
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.
input | A matrix which the reduction will be performed on. |
reducePolicy | The policy specifying how reduction will be performed, can be either REDUCE_ROW_WISE_ONLY of REDUCE_COL_WISE_ONLY |
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.
input | A matrix which the reduction will be performed on. |
reducePolicy | The policy specifying how reduction will be performed, can be either REDUCE_ROW_WISE_ONLY of REDUCE_COL_WISE_ONLY |
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().
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.
inputBegin | An iterator to the first element in the range. |
inputEnd | An iterator to the last element of the range. |
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.
input | A vector which the reduction will be performed on. |
useNumGPU | Integer specifying how many devices to use. 0 = implementation decides. |
References skepu::Vector< T >::begin(), skepu::Reduce< ReduceFuncRowWise, ReduceFuncColWise >::CU(), and skepu::Vector< T >::end().
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.
input | A matrix which the reduction will be performed on. |
useNumGPU | Integer specifying how many devices to use. 0 = implementation decides. |
References skepu::Reduce< ReduceFuncRowWise, ReduceFuncColWise >::CU().
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.
input | A sparse matrix which the reduction will be performed on. |
useNumGPU | Integer specifying how many devices to use. 0 = implementation decides. |
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().
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.
inputBegin | An iterator to the first element in the range. |
inputEnd | An iterator to the last element of the range. |
useNumGPU | Integer specifying how many devices to use. 0 = implementation decides. |
References skepu::getNumBlocksAndThreads(), and MAX_GPU_DEVICES.
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.
input | A matrix which the reduction will be performed on. |
reducePolicy | The policy specifying how reduction will be performed, can be either REDUCE_ROW_WISE_ONLY of REDUCE_COL_WISE_ONLY |
useNumGPU | Integer specifying how many devices to use. 0 = implementation decides. |
References skepu::Device_CU::getNoConcurrentKernels(), skepu::getNumBlocksAndThreads(), and MAX_GPU_DEVICES.
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.
input | A sparse matrix which the reduction will be performed on. |
reducePolicy | The policy specifying how reduction will be performed, can be either REDUCE_ROW_WISE_ONLY of REDUCE_COL_WISE_ONLY |
useNumGPU | Integer specifying how many devices to use. 0 = implementation decides. |
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().
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.
input | A matrix which the reduction will be performed on. |
reducePolicy | The policy specifying how reduction will be performed, can be either REDUCE_ROW_WISE_ONLY of REDUCE_COL_WISE_ONLY |
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.
input | A matrix which the reduction will be performed on. |
reducePolicy | The policy specifying how reduction will be performed, can be either REDUCE_ROW_WISE_ONLY of REDUCE_COL_WISE_ONLY |
References skepu::SparseMatrix< T >::total_nnz(), skepu::SparseMatrix< T >::total_rows(), and skepu::SparseMatrix< T >::updateHost().
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.
input | A vector which the reduction will be performed on. |
References skepu::Vector< T >::begin(), skepu::Vector< T >::end(), and skepu::Reduce< ReduceFuncRowWise, ReduceFuncColWise >::OMP().
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.
input | A matrix which the reduction will be performed on. |
References skepu::Reduce< ReduceFuncRowWise, ReduceFuncColWise >::OMP().
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.
input | A sparse matrix which the reduction will be performed on. |
References skepu::SparseMatrix< T >::get_values(), skepu::SparseMatrix< T >::total_nnz(), and skepu::SparseMatrix< T >::updateHost().
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.
inputBegin | An iterator to the first element in the range. |
inputEnd | An iterator to the last element of the range. |
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.
input | A vector which the reduction will be performed on. |
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().
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.
input | A matrix which the reduction will be performed on. |
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().
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.
input | A sparse matrix which the reduction will be performed on. |
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().
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.
input | A matrix which the reduction will be performed on. |
reducePolicy | The policy specifying how reduction will be performed, can be either REDUCE_ROW_WISE_ONLY of REDUCE_COL_WISE_ONLY |
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().
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.
input | A sparse matrix which the reduction will be performed on. |
reducePolicy | The policy specifying how reduction will be performed, can be either REDUCE_ROW_WISE_ONLY of REDUCE_COL_WISE_ONLY |
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().
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.
inputBegin | An iterator to the first element in the range. |
inputEnd | An iterator to the last element of the range. |
References skepu::Reduce< ReduceFuncRowWise, ReduceFuncColWise >::CL(), skepu::Reduce< ReduceFuncRowWise, ReduceFuncColWise >::CPU(), skepu::Reduce< ReduceFuncRowWise, ReduceFuncColWise >::CU(), and skepu::Reduce< ReduceFuncRowWise, ReduceFuncColWise >::OMP().