af_kronProd

The C interface for Kronecker product. More...

Device pointer interface: Kronecker product

Kronecker Tensor Product: Computes Kronecker product of matrices A, B.

Parameters
d_COutput Matrix
mANumber of rows of input matrix A
nANumber of columns of input matrix A
d_ALeft Input Matrix
batch_ANumber of tiles in matrix A
mBNumber of rows of input matrix B
nBNumber of columns of input matrix B
d_BRight Input Matrix
batch_BNumber of tiles in matrix B
afError af_kronProd_SS (float *d_C, unsigned mA, unsigned nA, const float *d_A, unsigned batch_A, unsigned mB, unsigned nB, const float *d_B, unsigned batch_B)
 Single Precision Kronecker Tensor Product - Real x Real. More...
 
afError af_kronProd_SC (cfloat *d_C, unsigned mA, unsigned nA, const float *d_A, unsigned batch_A, unsigned mB, unsigned nB, const cfloat *d_B, unsigned batch_B)
 Single Precision Kronecker Tensor Product - Real x Complex. More...
 
afError af_kronProd_CS (cfloat *d_C, unsigned mA, unsigned nA, const cfloat *d_A, unsigned batch_A, unsigned mB, unsigned nB, const float *d_B, unsigned batch_B)
 Single Precision Kronecker Tensor Product - Complex x Real. More...
 
afError af_kronProd_CC (cfloat *d_C, unsigned mA, unsigned nA, const cfloat *d_A, unsigned batch_A, unsigned mB, unsigned nB, const cfloat *d_B, unsigned batch_B)
 Single Precision Kronecker Tensor Product - Complex x Complex. More...
 
afError af_kronProd_SD (float *d_C, unsigned mA, unsigned nA, const float *d_A, unsigned batch_A, unsigned mB, unsigned nB, const double *d_B, unsigned batch_B)
 Kronecker Tensor Product - Single-precision Real x Double-precision Real. More...
 
afError af_kronProd_SZ (cfloat *d_C, unsigned mA, unsigned nA, const float *d_A, unsigned batch_A, unsigned mB, unsigned nB, const cdouble *d_B, unsigned batch_B)
 Kronecker Tensor Product - Single-precision Real x Double-precision Complex. More...
 
afError af_kronProd_CD (cfloat *d_C, unsigned mA, unsigned nA, const cfloat *d_A, unsigned batch_A, unsigned mB, unsigned nB, const double *d_B, unsigned batch_B)
 Kronecker Tensor Product - Single-precision Complex x Double-precision Real. More...
 
afError af_kronProd_CZ (cfloat *d_C, unsigned mA, unsigned nA, const cfloat *d_A, unsigned batch_A, unsigned mB, unsigned nB, const cdouble *d_B, unsigned batch_B)
 Kronecker Tensor Product - Single-precision Complex x Double-precision Complex. More...
 
afError af_kronProd_DS (float *d_C, unsigned mA, unsigned nA, const double *d_A, unsigned batch_A, unsigned mB, unsigned nB, const float *d_B, unsigned batch_B)
 Kronecker Tensor Product - Double-precision Real x Single-precision Real. More...
 
afError af_kronProd_DC (cfloat *d_C, unsigned mA, unsigned nA, const double *d_A, unsigned batch_A, unsigned mB, unsigned nB, const cfloat *d_B, unsigned batch_B)
 Kronecker Tensor Product - Double-precision Real x Single-precision Complex. More...
 
afError af_kronProd_ZS (cfloat *d_C, unsigned mA, unsigned nA, const cdouble *d_A, unsigned batch_A, unsigned mB, unsigned nB, const float *d_B, unsigned batch_B)
 Kronecker Tensor Product - Double-precision Complex x Single-precision Real. More...
 
afError af_kronProd_ZC (cfloat *d_C, unsigned mA, unsigned nA, const cdouble *d_A, unsigned batch_A, unsigned mB, unsigned nB, const cfloat *d_B, unsigned batch_B)
 Kronecker Tensor Product - Double-precision Complex x Single-precision Complex. More...
 
afError af_kronProd_DD (double *d_C, unsigned mA, unsigned nA, const double *d_A, unsigned batch_A, unsigned mB, unsigned nB, const double *d_B, unsigned batch_B)
 Double Precision Kronecker Tensor Product - Real x Complex. More...
 
afError af_kronProd_DZ (cdouble *d_C, unsigned mA, unsigned nA, const double *d_A, unsigned batch_A, unsigned mB, unsigned nB, const cdouble *d_B, unsigned batch_B)
 Double Precision Kronecker Tensor Product - Real x Complex. More...
 
afError af_kronProd_ZD (cdouble *d_C, unsigned mA, unsigned nA, const cdouble *d_A, unsigned batch_A, unsigned mB, unsigned nB, const double *d_B, unsigned batch_B)
 Double Precision Kronecker Tensor Product - Complex x Real. More...
 
afError af_kronProd_ZZ (cdouble *d_C, unsigned mA, unsigned nA, const cdouble *d_A, unsigned batch_A, unsigned mB, unsigned nB, const cdouble *d_B, unsigned batch_B)
 Double Precision Kronecker Tensor Product - Complex x Complex. More...
 

Detailed Description

The C interface for Kronecker product.

Compute the Kronecker product of a matrix. This outer product is a block matrix such that if the input matrices are (m by n) and (p by q), then the output matrix is (mp by nq).

float ha[] = {1, 3, 2, 4};
float hb[] = {0, 6, 5, 7};
array a = array(2, 2, ha);
// a = 1 2
// 3 4
array b = array(2, 2, hb);
// b = 0 5
// 6 7
// Create space for the result
array c = array(4, 4, f32);
float* da = a.device<float>();
float* db = b.device<float>();
float* dc = c.device<float>();
af_kronProd_SS(dc, 2, 2, da, 0, 2, 2, db, 0);
print(c);
// c =
// 0.0000 5.0000 0.0000 10.0000
// 6.0000 7.0000 12.0000 14.0000
// 0.0000 15.0000 0.0000 20.0000
// 18.0000 21.0000 24.0000 28.0000

Function Documentation

afError af_kronProd_SS ( float *  d_C,
unsigned  mA,
unsigned  nA,
const float *  d_A,
unsigned  batch_A,
unsigned  mB,
unsigned  nB,
const float *  d_B,
unsigned  batch_B 
)

Single Precision Kronecker Tensor Product - Real x Real.

afError af_kronProd_SC ( cfloat d_C,
unsigned  mA,
unsigned  nA,
const float *  d_A,
unsigned  batch_A,
unsigned  mB,
unsigned  nB,
const cfloat d_B,
unsigned  batch_B 
)

Single Precision Kronecker Tensor Product - Real x Complex.

afError af_kronProd_CS ( cfloat d_C,
unsigned  mA,
unsigned  nA,
const cfloat d_A,
unsigned  batch_A,
unsigned  mB,
unsigned  nB,
const float *  d_B,
unsigned  batch_B 
)

Single Precision Kronecker Tensor Product - Complex x Real.

afError af_kronProd_CC ( cfloat d_C,
unsigned  mA,
unsigned  nA,
const cfloat d_A,
unsigned  batch_A,
unsigned  mB,
unsigned  nB,
const cfloat d_B,
unsigned  batch_B 
)

Single Precision Kronecker Tensor Product - Complex x Complex.

afError af_kronProd_SD ( float *  d_C,
unsigned  mA,
unsigned  nA,
const float *  d_A,
unsigned  batch_A,
unsigned  mB,
unsigned  nB,
const double *  d_B,
unsigned  batch_B 
)

Kronecker Tensor Product - Single-precision Real x Double-precision Real.

afError af_kronProd_SZ ( cfloat d_C,
unsigned  mA,
unsigned  nA,
const float *  d_A,
unsigned  batch_A,
unsigned  mB,
unsigned  nB,
const cdouble d_B,
unsigned  batch_B 
)

Kronecker Tensor Product - Single-precision Real x Double-precision Complex.

afError af_kronProd_CD ( cfloat d_C,
unsigned  mA,
unsigned  nA,
const cfloat d_A,
unsigned  batch_A,
unsigned  mB,
unsigned  nB,
const double *  d_B,
unsigned  batch_B 
)

Kronecker Tensor Product - Single-precision Complex x Double-precision Real.

afError af_kronProd_CZ ( cfloat d_C,
unsigned  mA,
unsigned  nA,
const cfloat d_A,
unsigned  batch_A,
unsigned  mB,
unsigned  nB,
const cdouble d_B,
unsigned  batch_B 
)

Kronecker Tensor Product - Single-precision Complex x Double-precision Complex.

afError af_kronProd_DS ( float *  d_C,
unsigned  mA,
unsigned  nA,
const double *  d_A,
unsigned  batch_A,
unsigned  mB,
unsigned  nB,
const float *  d_B,
unsigned  batch_B 
)

Kronecker Tensor Product - Double-precision Real x Single-precision Real.

afError af_kronProd_DC ( cfloat d_C,
unsigned  mA,
unsigned  nA,
const double *  d_A,
unsigned  batch_A,
unsigned  mB,
unsigned  nB,
const cfloat d_B,
unsigned  batch_B 
)

Kronecker Tensor Product - Double-precision Real x Single-precision Complex.

afError af_kronProd_ZS ( cfloat d_C,
unsigned  mA,
unsigned  nA,
const cdouble d_A,
unsigned  batch_A,
unsigned  mB,
unsigned  nB,
const float *  d_B,
unsigned  batch_B 
)

Kronecker Tensor Product - Double-precision Complex x Single-precision Real.

afError af_kronProd_ZC ( cfloat d_C,
unsigned  mA,
unsigned  nA,
const cdouble d_A,
unsigned  batch_A,
unsigned  mB,
unsigned  nB,
const cfloat d_B,
unsigned  batch_B 
)

Kronecker Tensor Product - Double-precision Complex x Single-precision Complex.

afError af_kronProd_DD ( double *  d_C,
unsigned  mA,
unsigned  nA,
const double *  d_A,
unsigned  batch_A,
unsigned  mB,
unsigned  nB,
const double *  d_B,
unsigned  batch_B 
)

Double Precision Kronecker Tensor Product - Real x Complex.

afError af_kronProd_DZ ( cdouble d_C,
unsigned  mA,
unsigned  nA,
const double *  d_A,
unsigned  batch_A,
unsigned  mB,
unsigned  nB,
const cdouble d_B,
unsigned  batch_B 
)

Double Precision Kronecker Tensor Product - Real x Complex.

afError af_kronProd_ZD ( cdouble d_C,
unsigned  mA,
unsigned  nA,
const cdouble d_A,
unsigned  batch_A,
unsigned  mB,
unsigned  nB,
const double *  d_B,
unsigned  batch_B 
)

Double Precision Kronecker Tensor Product - Complex x Real.

afError af_kronProd_ZZ ( cdouble d_C,
unsigned  mA,
unsigned  nA,
const cdouble d_A,
unsigned  batch_A,
unsigned  mB,
unsigned  nB,
const cdouble d_B,
unsigned  batch_B 
)

Double Precision Kronecker Tensor Product - Complex x Complex.