the C interface for anytrue More...

All Elements

Parameters
[out]countScalar and on host
[in]numelThe number of elements in the vector.
[in]matThe input stream
afError af_anytrue_vector_S (bool *h_dst, unsigned numel, const float *d_src)
 any along single precision vector More...
 
afError af_anytrue_vector_B (bool *h_dst, unsigned numel, const bool *d_src)
 any along boolean vector More...
 
afError af_anytrue_vector_I (bool *h_dst, unsigned numel, const int *d_src)
 any along 32-bit signed integer vector More...
 
afError af_anytrue_vector_U (bool *h_dst, unsigned numel, const unsigned *d_src)
 any along 32-bit unsigned integer vector More...
 
afError af_anytrue_vector_C (bool *h_dst, unsigned numel, const cfloat *d_src)
 any along single precision, complex vector More...
 
afError af_anytrue_vector_D (bool *h_dst, unsigned numel, const double *d_src)
 any along double precision vector More...
 
afError af_anytrue_vector_Z (bool *h_dst, unsigned numel, const cdouble *d_src)
 any along double precision, complex 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_anytrue_S (bool *d_dst, unsigned ndims, const unsigned *dims, const float *d_src, int dim)
 any along a dimension in single precision matrix More...
 
afError af_anytrue_B (bool *d_dst, unsigned ndims, const unsigned *dims, const bool *d_src, int dim)
 any along a dimension in boolean matrix More...
 
afError af_anytrue_I (bool *d_dst, unsigned ndims, const unsigned *dims, const int *d_src, int dim)
 any along a dimension in 32-bit signed integer matrix More...
 
afError af_anytrue_U (bool *d_dst, unsigned ndims, const unsigned *dims, const unsigned *d_src, int dim)
 any along a dimension in 32-bit unsigned integer matrix More...
 
afError af_anytrue_C (bool *d_dst, unsigned ndims, const unsigned *dims, const cfloat *d_src, int dim)
 any along a dimension in single precision, complex matrix More...
 
afError af_anytrue_D (bool *d_dst, unsigned ndims, const unsigned *dims, const double *d_src, int dim)
 any along a dimension in double precision matrix More...
 
afError af_anytrue_Z (bool *d_dst, unsigned ndims, const unsigned *dims, const cdouble *d_src, int dim)
 any along a dimension in double precision, complex matrix More...
 

Detailed Description

the C interface for anytrue

Verify if any of the elements are non zero.

These functions can also be used with conditions as parameters.
In such a case, the input array to the function is a boolean array.
bool hx[] = { true,true,false,true };
array x1(4,1, hx); // 4x1 vector
printf("%d,%d\n", anytrue<bool>(x1))// 0,0
array y1 = randu(100, 1);
array y2 = anytrue(y1 > 0.5); // y2 is 1 where all values in the
// dimension are true, otherwise 0.

Function Documentation

afError af_anytrue_vector_S ( bool *  h_dst,
unsigned  numel,
const float *  d_src 
)

any along single precision vector

afError af_anytrue_vector_B ( bool *  h_dst,
unsigned  numel,
const bool *  d_src 
)

any along boolean vector

afError af_anytrue_vector_I ( bool *  h_dst,
unsigned  numel,
const int *  d_src 
)

any along 32-bit signed integer vector

afError af_anytrue_vector_U ( bool *  h_dst,
unsigned  numel,
const unsigned *  d_src 
)

any along 32-bit unsigned integer vector

afError af_anytrue_vector_C ( bool *  h_dst,
unsigned  numel,
const cfloat d_src 
)

any along single precision, complex vector

afError af_anytrue_vector_D ( bool *  h_dst,
unsigned  numel,
const double *  d_src 
)

any along double precision vector

afError af_anytrue_vector_Z ( bool *  h_dst,
unsigned  numel,
const cdouble d_src 
)

any along double precision, complex vector

afError af_anytrue_S ( bool *  d_dst,
unsigned  ndims,
const unsigned *  dims,
const float *  d_src,
int  dim 
)

any along a dimension in single precision matrix

afError af_anytrue_B ( bool *  d_dst,
unsigned  ndims,
const unsigned *  dims,
const bool *  d_src,
int  dim 
)

any along a dimension in boolean matrix

afError af_anytrue_I ( bool *  d_dst,
unsigned  ndims,
const unsigned *  dims,
const int *  d_src,
int  dim 
)

any along a dimension in 32-bit signed integer matrix

afError af_anytrue_U ( bool *  d_dst,
unsigned  ndims,
const unsigned *  dims,
const unsigned *  d_src,
int  dim 
)

any along a dimension in 32-bit unsigned integer matrix

afError af_anytrue_C ( bool *  d_dst,
unsigned  ndims,
const unsigned *  dims,
const cfloat d_src,
int  dim 
)

any along a dimension in single precision, complex matrix

afError af_anytrue_D ( bool *  d_dst,
unsigned  ndims,
const unsigned *  dims,
const double *  d_src,
int  dim 
)

any along a dimension in double precision matrix

afError af_anytrue_Z ( bool *  d_dst,
unsigned  ndims,
const unsigned *  dims,
const cdouble d_src,
int  dim 
)

any along a dimension in double precision, complex matrix