GPUMLib  0.2.2
GPU Machine Learning Library
Static Public Member Functions | Static Public Attributes | List of all members
Reduction Class Reference

Provides reduction functions (Sum, Average, Max, Min, ...). More...

#include <reduction.h>

Static Public Member Functions

static void Sum (DeviceArray< cudafloat > &inputs, cudafloat *output, cudafloat multiplyFactor=CUDA_VALUE(1.0), cudaStream_t stream=nullptr)
 
static void Sum (DeviceArray< cudafloat > &inputs, DeviceArray< cudafloat > &output, cudafloat multiplyFactor=CUDA_VALUE(1.0), cudaStream_t stream=nullptr)
 
static void Average (DeviceArray< cudafloat > &inputs, DeviceArray< cudafloat > &output, cudaStream_t stream=nullptr)
 
static void Min (DeviceArray< cudafloat > &inputs, DeviceArray< cudafloat > &output, cudaStream_t stream=nullptr)
 
static void Min (DeviceMatrix< cudafloat > &inputs, DeviceArray< cudafloat > &output, cudaStream_t stream=nullptr)
 
static void MinIndex (DeviceArray< cudafloat > &inputs, DeviceArray< cudafloat > &min, DeviceArray< int > &minIndex, cudaStream_t stream=nullptr)
 
static void MinIndex (DeviceMatrix< cudafloat > &inputs, DeviceArray< cudafloat > &min, DeviceArray< int > &minIndex, cudaStream_t stream=nullptr)
 
static void Max (DeviceArray< cudafloat > &inputs, DeviceArray< cudafloat > &output, cudaStream_t stream=nullptr)
 
static void Max (DeviceMatrix< cudafloat > &inputs, DeviceArray< cudafloat > &output, cudaStream_t stream=nullptr)
 
static void MaxIndex (DeviceArray< cudafloat > &inputs, DeviceArray< cudafloat > &max, DeviceArray< int > &maxIndex, cudaStream_t stream=nullptr)
 
static void MaxIndex (DeviceMatrix< cudafloat > &inputs, DeviceArray< cudafloat > &max, DeviceArray< int > &maxIndex, cudaStream_t stream=nullptr)
 

Static Public Attributes

static DeviceArray< cudafloattemporaryBuffer
 Temporary buffer used for the reduction tasks. Programmers may take advantage of it for other tasks (hence, it is declared as public).
 

Detailed Description

Provides reduction functions (Sum, Average, Max, Min, ...).

Definition at line 101 of file reduction.h.

Member Function Documentation

static void Average ( DeviceArray< cudafloat > &  inputs,
DeviceArray< cudafloat > &  output,
cudaStream_t  stream = nullptr 
)
inlinestatic

Averages the elements of an input array, placing the result in the output

Parameters
[in]inputsinput array for which we want to compute the average
[out]outputArray that will contain the average (in position 0)
[in]streamCUDA stream (optional)

Definition at line 137 of file reduction.h.

static void Max ( DeviceArray< cudafloat > &  inputs,
DeviceArray< cudafloat > &  output,
cudaStream_t  stream = nullptr 
)
inlinestatic

Computes the maximum of an input array, placing the result in the output

Parameters
[in]inputsinput array for which we want to compute the maximum
[out]outputArray that will contain the maximum (in position 0)
[in]streamCUDA stream (optional)

Definition at line 180 of file reduction.h.

static void Max ( DeviceMatrix< cudafloat > &  inputs,
DeviceArray< cudafloat > &  output,
cudaStream_t  stream = nullptr 
)
inlinestatic

Computes the maximum of an input matrix, placing the result in the output

Parameters
[in]inputsinput matrix for which we want to compute the maximum
[out]outputArray that will contain the maximum (in position 0)
[in]streamCUDA stream (optional)

Definition at line 188 of file reduction.h.

static void MaxIndex ( DeviceArray< cudafloat > &  inputs,
DeviceArray< cudafloat > &  max,
DeviceArray< int > &  maxIndex,
cudaStream_t  stream = nullptr 
)
inlinestatic

Computes the maximum of an input array as well as its index within the array

Parameters
[in]inputsinput array for which we want to compute the minimum
[out]maxArray that will contain the minimum (in position 0)
[out]maxIndexArray that will contain the index of the minimum within the array (in position 0)
[in]streamCUDA stream (optional)

Definition at line 197 of file reduction.h.

static void MaxIndex ( DeviceMatrix< cudafloat > &  inputs,
DeviceArray< cudafloat > &  max,
DeviceArray< int > &  maxIndex,
cudaStream_t  stream = nullptr 
)
inlinestatic

Computes the maximum of an input matrix as well as its (1-D) index within the array

Parameters
[in]inputsinput matrix for which we want to compute the minimum
[out]maxArray that will contain the minimum (in position 0)
[out]maxIndexArray that will contain the index of the minimum within the array (in position 0)
[in]streamCUDA stream (optional)

Definition at line 206 of file reduction.h.

static void Min ( DeviceArray< cudafloat > &  inputs,
DeviceArray< cudafloat > &  output,
cudaStream_t  stream = nullptr 
)
inlinestatic

Computes the minimum of an input array, placing the result in the output

Parameters
[in]inputsinput array for which we want to compute the minimum
[out]outputArray that will contain the minimum (in position 0)
[in]streamCUDA stream (optional)

Definition at line 146 of file reduction.h.

static void Min ( DeviceMatrix< cudafloat > &  inputs,
DeviceArray< cudafloat > &  output,
cudaStream_t  stream = nullptr 
)
inlinestatic

Computes the minimum of an input matrix, placing the result in the output

Parameters
[in]inputsinput matrix for which we want to compute the minimum
[out]outputArray that will contain the minimum (in position 0)
[in]streamCUDA stream (optional)

Definition at line 154 of file reduction.h.

static void MinIndex ( DeviceArray< cudafloat > &  inputs,
DeviceArray< cudafloat > &  min,
DeviceArray< int > &  minIndex,
cudaStream_t  stream = nullptr 
)
inlinestatic

Computes the minimum of an input array as well as its index within the array

Parameters
[in]inputsinput array for which we want to compute the minimum
[out]minArray that will contain the minimum (in position 0)
[out]minIndexArray that will contain the index of the minimum within the array (in position 0)
[in]streamCUDA stream (optional)

Definition at line 163 of file reduction.h.

static void MinIndex ( DeviceMatrix< cudafloat > &  inputs,
DeviceArray< cudafloat > &  min,
DeviceArray< int > &  minIndex,
cudaStream_t  stream = nullptr 
)
inlinestatic

Computes the minimum of an input matrix as well as its (1-D) index within the matrix

Parameters
[in]inputsinput matrix for which we want to compute the minimum
[out]minArray that will contain the minimum (in position 0)
[out]minIndexArray that will contain the index of the minimum within the array (in position 0)
[in]streamCUDA stream (optional)

Definition at line 172 of file reduction.h.

static void Sum ( DeviceArray< cudafloat > &  inputs,
cudafloat output,
cudafloat  multiplyFactor = CUDA_VALUE(1.0),
cudaStream_t  stream = nullptr 
)
inlinestatic

Sums all the elements of an input array, multiplies the sum by a given factor and places the result in the output

Parameters
[in]inputsValues to be summed
[out]outputPointer to the memory address that will contain the sum output
[in]multiplyFactorMultiply factor (optional, by default 1.0)
[in]streamCUDA stream (optional)

Definition at line 120 of file reduction.h.

static void Sum ( DeviceArray< cudafloat > &  inputs,
DeviceArray< cudafloat > &  output,
cudafloat  multiplyFactor = CUDA_VALUE(1.0),
cudaStream_t  stream = nullptr 
)
inlinestatic

Sums all the elements of an input array, multiplies the sum by a given factor and places the result in the output

Parameters
[in]inputsValues to be summed
[out]outputArray that will contain the sum output (in position 0)
[in]multiplyFactorMultiply factor (optional, by default 1.0)
[in]streamCUDA stream (optional)

Definition at line 129 of file reduction.h.


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