Hello,
I am using the cgemm function and I get wrong results. I think I am doing something wrong with the memory allocation of the matrixes. My code is:
int main(){
PLASMA_Complex32_t *A = (PLASMA_Complex32_t *)malloc(lda*M*(sizeof(PLASMA_Complex32_t*)));
PLASMA_Complex32_t *X = (PLASMA_Complex32_t *)malloc(ldb*N*(sizeof(PLASMA_Complex32_t*)));
PLASMA_Complex32_t *Y = (PLASMA_Complex32_t *)malloc(ldc*N*(sizeof(PLASMA_Complex32_t*)));
/* Check if unable to allocate memory */
if ((!A)||(!X)||(!Y)){
printf("Out of Memory \n ");
return 0;
}
int times,i,j,info;
int cores=1;
/* Plasma Initialization */
info=PLASMA_Init(cores);
printf("-- PLASMA is initialized to run on %d cores. \n",cores);
for (i=0;i<M;i++)
*Y=0.0;
for (j=0;j<Z;j++){
*A = (float) (5);
}
for (i=0;i<K;i++){
*X = (float) (5);
}
for (times=0;times!=TIMES;times++){
info=PLASMA_cgemm(PlasmaTrans,PlasmaTrans, M, N, K, alpha, A, lda, X, ldb, beta, Y, ldc);
}
if ((info != 0))
printf("-- Error in example ! \n");
else
printf("-- Example successful ! \n");
free(A); free(X); free(Y);
PLASMA_Finalize();
return 0;
}
Could you please help me?
