the C interface for mul More...

All Elements

Parameters
[out]countScalar and on host
[in]numelThe number of elements in the vector.
[in]matThe input stream
afError af_mul_vector_S (float *h_dst, unsigned numel, const float *d_src)
 multiplication of the values of a single precision vector More...
 
afError af_mul_vector_I (int *h_dst, unsigned numel, const int *d_src)
 multiplication of the values of a 32-bit signed integer vector More...
 
afError af_mul_vector_U (unsigned *h_dst, unsigned numel, const unsigned *d_src)
 multiplication of the values of a 32-bit unsigned integer vector More...
 
afError af_mul_vector_B (float *h_dst, unsigned numel, const bool *d_src)
 multiplication of the values of a boolean vector More...
 
afError af_mul_vector_C (cfloat *h_dst, unsigned numel, const cfloat *d_src)
 multiplication of the values of a single precision, complex vector More...
 
afError af_mul_vector_D (double *h_dst, unsigned numel, const double *d_src)
 multiplication of the values of a double precision vector More...
 
afError af_mul_vector_Z (cdouble *h_dst, unsigned numel, const cdouble *d_src)
 multiplication of the values of a 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_mul_S (float *d_dst, unsigned ndims, const unsigned *dims, const float *d_src, int dim)
 multiplication of the values along a dimension in single precision matrix More...
 
afError af_mul_I (int *d_dst, unsigned ndims, const unsigned *dims, const int *d_src, int dim)
 multiplication of the value along a dimension in 32-bit signed integer matrix More...
 
afError af_mul_U (unsigned *d_dst, unsigned ndims, const unsigned *dims, const unsigned *d_src, int dim)
 multiplication of the value along a dimension in 32-bit unsigned integer matrix More...
 
afError af_mul_B (float *d_dst, unsigned ndims, const unsigned *dims, const bool *d_src, int dim)
 multiplication of the value along a dimension in boolean matrix More...
 
afError af_mul_C (cfloat *d_dst, unsigned ndims, const unsigned *dims, const cfloat *d_src, int dim)
 multiplication of the values along a dimension in single precision, complex matrix More...
 
afError af_mul_D (double *d_dst, unsigned ndims, const unsigned *dims, const double *d_src, int dim)
 multiplication of the values along a dimension in double precision matrix More...
 
afError af_mul_Z (cdouble *d_dst, unsigned ndims, const unsigned *dims, const cdouble *d_src, int dim)
 multiplication of the values along a dimension in double precision, complex matrix More...
 

Detailed Description

the C interface for mul

The first mul function computes the product of elements
of the array along a particular dimension. This function
returns an array that is the size of the dimension specified
by the parameter.
float x[] = {5,1,7,3,2,5};
array input(2,3,x); // [5 7 2]
// [1 3 5]
// Along first non-singleton dimension (down columns)
array output = mul(input);
print(output); //output = [5 21 10]
//Along dimension 1 (rows)
array output = mul(input, 1);
print(output); //output = [70]
// [15]

The second mul function computes the product of all values of an array and returns the product to host memory.

float hx[] = { -3, -5, 2, -9 };
array x1(2,2, hx); // 2x2 matrix
array x2(4,1, hx); // 4x1 vector
printf("%g,%g\n", mul<float>(x1), mul<float>(x2)); // -270,-270

Function Documentation

afError af_mul_vector_S ( float *  h_dst,
unsigned  numel,
const float *  d_src 
)

multiplication of the values of a single precision vector

afError af_mul_vector_I ( int *  h_dst,
unsigned  numel,
const int *  d_src 
)

multiplication of the values of a 32-bit signed integer vector

afError af_mul_vector_U ( unsigned *  h_dst,
unsigned  numel,
const unsigned *  d_src 
)

multiplication of the values of a 32-bit unsigned integer vector

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

multiplication of the values of a boolean vector

afError af_mul_vector_C ( cfloat h_dst,
unsigned  numel,
const cfloat d_src 
)

multiplication of the values of a single precision, complex vector

afError af_mul_vector_D ( double *  h_dst,
unsigned  numel,
const double *  d_src 
)

multiplication of the values of a double precision vector

afError af_mul_vector_Z ( cdouble h_dst,
unsigned  numel,
const cdouble d_src 
)

multiplication of the values of a double precision, complex vector

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

multiplication of the values along a dimension in single precision matrix

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

multiplication of the value along a dimension in 32-bit signed integer matrix

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

multiplication of the value along a dimension in 32-bit unsigned integer matrix

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

multiplication of the value along a dimension in boolean matrix

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

multiplication of the values along a dimension in single precision, complex matrix

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

multiplication of the values along a dimension in double precision matrix

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

multiplication of the values along a dimension in double precision, complex matrix