/** * * @file testing_ztrmm.c * * @copyright 2009-2014 The University of Tennessee and The University of * Tennessee Research Foundation. All rights reserved. * @copyright 2012-2014 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria, * Univ. Bordeaux. All rights reserved. * *** * * * MORSE testing routines * MORSE is a software package provided by Univ. of Tennessee, * Univ. of California Berkeley and Univ. of Colorado Denver * * @version 2.5.0 * @comment This file has been automatically generated * from Plasma 2.5.0 for MORSE 1.0.0 * @author Mathieu Faverge * @author Emmanuel Agullo * @author Cedric Castagnede * @date 2010-11-15 * @precisions normal z -> c d s * **/ #include #include #include #include #include #include #include #include #include "testing_zauxiliary.h" #undef REAL #define COMPLEX static int check_solution(MORSE_enum side, MORSE_enum uplo, MORSE_enum trans, MORSE_enum diag, int M, int N, MORSE_Complex64_t alpha, MORSE_Complex64_t *A, int LDA, MORSE_Complex64_t *Bref, MORSE_Complex64_t *Bmorse, int LDB); int testing_ztrmm(int argc, char **argv) { int hres = 0; /* Check for number of arguments*/ if ( argc != 5 ) { USAGE("TRMM", "alpha M N LDA LDB", " - alpha : alpha coefficient\n" " - M : number of rows of matrices B\n" " - N : number of columns of matrices B\n" " - LDA : leading dimension of matrix A\n" " - LDB : leading dimension of matrix B\n"); return -1; } MORSE_Complex64_t alpha = (MORSE_Complex64_t) atol(argv[0]); int M = atoi(argv[1]); int N = atoi(argv[2]); int LDA = atoi(argv[3]); int LDB = atoi(argv[4]); double eps; int info_solution; int s, u, t, d, i; int LDAxM = LDA*max(M,N); int LDBxN = LDB*max(M,N); MORSE_Complex64_t *A = (MORSE_Complex64_t *)malloc(LDAxM*sizeof(MORSE_Complex64_t)); MORSE_Complex64_t *B = (MORSE_Complex64_t *)malloc(LDBxN*sizeof(MORSE_Complex64_t)); MORSE_Complex64_t *Binit = (MORSE_Complex64_t *)malloc(LDBxN*sizeof(MORSE_Complex64_t)); MORSE_Complex64_t *Bfinal = (MORSE_Complex64_t *)malloc(LDBxN*sizeof(MORSE_Complex64_t)); /* Check if unable to allocate memory */ if ( (!A) || (!B) || (!Binit) || (!Bfinal) ) { free(A); free(B); free(Binit); free(Bfinal); printf("Out of Memory \n "); return -2; } eps = LAPACKE_dlamch_work('e'); printf("\n"); printf("------ TESTS FOR CHAMELEON ZTRMM ROUTINE ------- \n"); printf(" Size of the Matrix B : %d by %d\n", M, N); printf("\n"); printf(" The matrix A is randomly generated for each test.\n"); printf("============\n"); printf(" The relative machine precision (eps) is to be %e \n",eps); printf(" Computational tests pass if scaled residuals are less than 10.\n"); /*---------------------------------------------------------- * TESTING ZTRMM */ /* Initialize A, B, C */ LAPACKE_zlarnv_work(IONE, ISEED, LDAxM, A); LAPACKE_zlarnv_work(IONE, ISEED, LDBxN, B); for(i=0;i 10.0) ) { printf("-- The solution is suspicious ! \n"); info_solution = 1; } else { printf("-- The solution is CORRECT ! \n"); info_solution= 0 ; } free(work); return info_solution; }