the C interface for minmax More...

All Elements

Parameters
[out]countScalar and on host
[in]numelThe number of elements in the vector.
[in]matThe input stream
afError af_minmax_vector_S (float2 *h_dst, unsigned numel, const float *d_src)
 Minimum and maximum value of a single precision vector. More...
 
afError af_minmax_vector_D (double2 *h_dst, unsigned numel, const double *d_src)
 Minimum and maximum value of a single precision vector. More...
 

Along a Dimension

Parameters
[out]countvector and on device
[in]numelThe number of elements in the vector.
[in]matThe input stream
[in]batchThe number of input tiles.
afError af_minmax_S (float2 *d_dst, unsigned ndims, const unsigned *dims, const float *d_src, int dim)
 Minimum and maximum value along a dimension in single precision matrix. More...
 
afError af_minmax_D (double2 *d_dst, unsigned ndims, const unsigned *dims, const double *d_src, int dim)
 Minimum and maximum value along a dimension in single precision matrix. More...
 

Detailed Description

the C interface for minmax

Returns the minimum and the maximum value along a given dimension
or for all of the elements of an array.
float ha[] = {1, 2, 3, 4, 5, 6};
array in = array(2, 3, ha);
array minvals, maxvals;
minmax(minvals, maxvals, in, 0);
print(minvals);
print(maxvals);
// minvals = 1.0000 3.0000 5.0000
// maxvals = 2.0000 4.0000 6.0000
minmax(minvals, maxvals, in, 1);
print(minvals);
print(maxvals);
// minvals = 1.0000
// 2.0000
//
// maxvals = 5.0000
// 6.0000

Function Documentation

afError af_minmax_vector_S ( float2 *  h_dst,
unsigned  numel,
const float *  d_src 
)

Minimum and maximum value of a single precision vector.

afError af_minmax_vector_D ( double2 *  h_dst,
unsigned  numel,
const double *  d_src 
)

Minimum and maximum value of a single precision vector.

afError af_minmax_S ( float2 *  d_dst,
unsigned  ndims,
const unsigned *  dims,
const float *  d_src,
int  dim 
)

Minimum and maximum value along a dimension in single precision matrix.

afError af_minmax_D ( double2 *  d_dst,
unsigned  ndims,
const unsigned *  dims,
const double *  d_src,
int  dim 
)

Minimum and maximum value along a dimension in single precision matrix.