A high-performance general-purpose compute library

Find the maximum values and their locations. More...

Functions

AFAPI array max (const array &in, const int dim=-1)
 C++ Interface for maximum values in an array.
 
AFAPI void max (array &val, array &idx, const array &in, const array &ragged_len, const int dim)
 C++ Interface for ragged max values in an array Uses an additional input array to determine the number of elements to use along the reduction axis.
 
template<typename T >
max (const array &in)
 C++ Interface for getting maximum value of an array.
 
AFAPI void max (array &val, array &idx, const array &in, const int dim=-1)
 C++ Interface for getting maximum values and their locations in an array.
 
template<typename T >
void max (T *val, unsigned *idx, const array &in)
 C++ Interface for getting maximum value and its location from the entire array.
 
AFAPI af_err af_max (af_array *out, const af_array in, const int dim)
 C Interface for maximum values in an array.
 
AFAPI af_err af_max_ragged (af_array *val, af_array *idx, const af_array in, const af_array ragged_len, const int dim)
 C Interface for finding ragged max values in an array Uses an additional input array to determine the number of elements to use along the reduction axis.
 
AFAPI af_err af_max_all (double *real, double *imag, const af_array in)
 C Interface for getting maximum value of an array.
 
AFAPI af_err af_imax (af_array *out, af_array *idx, const af_array in, const int dim)
 C Interface for getting maximum values and their locations in an array.
 
AFAPI af_err af_imax_all (double *real, double *imag, unsigned *idx, const af_array in)
 C Interface for getting maximum value and it's location from the entire array.
 

Detailed Description

Find the maximum values and their locations.

This function performs the operation across all batches present in the input simultaneously.

Function Documentation

◆ af_imax()

AFAPI af_err af_imax ( af_array out,
af_array idx,
const af_array  in,
const int  dim 
)

C Interface for getting maximum values and their locations in an array.

Parameters
[out]outwill contain the maximum of all values in in along dim
[out]idxwill contain the location of maximum of all values in in along dim
[in]inis the input array
[in]dimThe dimension along which the maximum value is extracted
Returns
AF_SUCCESS if the execution completes properly

◆ af_imax_all()

AFAPI af_err af_imax_all ( double *  real,
double *  imag,
unsigned *  idx,
const af_array  in 
)

C Interface for getting maximum value and it's location from the entire array.

Parameters
[out]realwill contain the real part of maximum value of all elements in input in
[out]imagwill contain the imaginary part of maximum value of all elements in input in
[out]idxwill contain the location of maximum of all values in in
[in]inis the input array
Returns
AF_SUCCESS if the execution completes properly
Note
imag is always set to 0 when in is real.

◆ af_max()

AFAPI af_err af_max ( af_array out,
const af_array  in,
const int  dim 
)

C Interface for maximum values in an array.

Parameters
[out]outwill contain the maximum of all values in in along dim
[in]inis the input array
[in]dimThe dimension along which the maximum value is extracted
Returns
AF_SUCCESS if the execution completes properly

◆ af_max_all()

AFAPI af_err af_max_all ( double *  real,
double *  imag,
const af_array  in 
)

C Interface for getting maximum value of an array.

Parameters
[out]realwill contain the real part of maximum value of all elements in input in
[out]imagwill contain the imaginary part of maximum value of all elements in input in
[in]inis the input array
Returns
AF_SUCCESS if the execution completes properly
Note
imag is always set to 0 when in is real.

◆ af_max_ragged()

AFAPI af_err af_max_ragged ( af_array val,
af_array idx,
const af_array  in,
const af_array  ragged_len,
const int  dim 
)

C Interface for finding ragged max values in an array Uses an additional input array to determine the number of elements to use along the reduction axis.

Parameters
[out]valwill contain the maximum ragged values in in along dim according to ragged_len
[out]idxwill contain the locations of the maximum ragged values in in along dim according to ragged_len
[in]incontains the input values to be reduced
[in]ragged_lenarray containing number of elements to use when reducing along dim
[in]dimThe dimension along which the max operation occurs
Returns
AF_SUCCESS if the execution completes properly
Note
NaN values are ignored

◆ max() [1/5]

AFAPI void max ( array val,
array idx,
const array in,
const array ragged_len,
const int  dim 
)

C++ Interface for ragged max values in an array Uses an additional input array to determine the number of elements to use along the reduction axis.

Parameters
[out]valwill contain the maximum ragged values in in along dim according to ragged_len
[out]idxwill contain the locations of the maximum ragged values in in along dim according to ragged_len
[in]incontains the input values to be reduced
[in]ragged_lenarray containing number of elements to use when reducing along dim
[in]dimThe dimension along which the max operation occurs
Note
NaN values are ignored

◆ max() [2/5]

AFAPI void max ( array val,
array idx,
const array in,
const int  dim = -1 
)

C++ Interface for getting maximum values and their locations in an array.

Parameters
[out]valwill contain the maximum values along dimension dim
[out]idxwill contain the locations of maximum all values along dimension dim
[in]inis the input array
[in]dimThe dimension along which the maximum value needs to be extracted
Note
dim is -1 by default. -1 denotes the first non-singleton dimension.
NaN values are ignored

◆ max() [3/5]

T max ( const array in)

C++ Interface for getting maximum value of an array.

Parameters
[in]inis the input array
Returns
the maximum of all values of in
Note
NaN values are ignored

◆ max() [4/5]

AFAPI array max ( const array in,
const int  dim = -1 
)

C++ Interface for maximum values in an array.

Parameters
[in]inis the input array
[in]dimThe dimension along which the maximum value needs to be extracted
Returns
result of maximum all values along dimension dim
Note
dim is -1 by default. -1 denotes the first non-singleton dimension.
NaN values are ignored
Examples
financial/heston_model.cpp, graphics/fractal.cpp, and graphics/gravity_sim.cpp.

◆ max() [5/5]

void max ( T *  val,
unsigned *  idx,
const array in 
)

C++ Interface for getting maximum value and its location from the entire array.

Parameters
[out]valcontains the maximum values in the input
[out]idxcontains the locations of maximum all values in the input
[in]inis the input array
Note
NaN values are ignored