HiCMA
Hierarchical Computations on Manycore Architectures
hcore_zuncompress.c
Go to the documentation of this file.
1 
16 #include "coreblas/coreblas.h"
17 #include "coreblas/lapacke.h"
18 #include <assert.h>
19 
20 //FIXME PREVIOUS DECLARION OF CBLAS_SADDR ~/hicma/chameleon/build/include/chameleon/coreblas/include/coreblas.h
21 #undef CBLAS_SADDR
22 #define CBLAS_SADDR(_val) (_val)
23 
26 
27 /*
28  * CD=AU*BV'.
29  * Rank of tile AU is in Ark.
30  * Rank of tile BV is in Brk.
31  * Multiplied tiles must have same rank.
32  * CD is dense output.
33 */
34 void HCORE_zuncompress(MORSE_enum transA, MORSE_enum transB,
35  int M, int N,
36  double alpha,
37  double *AU,
38  double *Ark,
39  int LDA,
40  double *BV,
41  double *Brk,
42  int LDB,
43  double beta,
44  double *CD,
45  int LDC
46 )
47 {
48  /*printf("%d|M:%d N:%d K:%d LDA:%d LDB:%d LDC:%d rk:%d acc:%e a:%e b:%e\n",*/
49  /*__LINE__, M, N, K, LDA, LDB, LDC, rk, acc, alpha, beta);*/
50 
51  /*
52  * NOTES:
53  * assumptions on matrix dimensions are marked as //ASSUMPTION
54  * I am currently allocating and freeing temporary buffers.
55  * They are marked as //ALLOCATE
56  */
57  /*printf("%d %d|%g->%d. %g %g, %g %g\n", */
58  /*__LINE__, __COUNTER__,*/
59  /*Crk[0], new_Crk, CU[0], CU[1], CV[0], CV[1]);*/
60  //hcore_dgemm(Aij, ik, Ajk, -1, rank, acc);
61  int64_t _Ark = (int64_t)(Ark[0]);
62  int64_t _Brk = (int64_t)(Brk[0]);
63 
65  printf("Ark:%d Brk:%d M:%d N:%d K:%d LDA:%d LDB:%d LDC:%d\n",
66  _Ark, _Brk, M, N, _Ark, LDA, LDB, LDC );
67  }
68  assert(_Ark == _Brk); // ranks must be same
69  double one = 1.0, zero = 0.0, minusone = -1.0;
71  /*hcfrk_printmat(AU, M, _Ark, LDA); */
72  /*hcfrk_printmat(BV, N, _Brk, LDB); */
73  }
74  cblas_dgemm(
75  CblasColMajor,
76  CblasNoTrans, CblasTrans,
77  M, N, _Ark,
78  CBLAS_SADDR(one), AU, LDA,
79  BV, LDB,
80  CBLAS_SADDR(zero), CD, LDC);
82  /*hcfrk_printmat(CD, M, N, LDC); */
83  }
84 
85 }
86 
int gemmfrk_print_mat
#define CBLAS_SADDR(_val)
void HCORE_zuncompress(MORSE_enum transA, MORSE_enum transB, int M, int N, double alpha, double *AU, double *Ark, int LDA, double *BV, double *Brk, int LDB, double beta, double *CD, int LDC)
int gemmfrk_print_index