/** * * @file core_zgessq.c * * @copyright 2009-2014 The University of Tennessee and The University of * Tennessee Research Foundation. All rights reserved. * @copyright 2012-2019 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria, * Univ. Bordeaux. All rights reserved. * *** * * @brief Chameleon core_zgessq CPU kernel * * @version 0.9.2 * @comment This file has been automatically generated * from Plasma 2.6.0 for CHAMELEON 0.9.2 * @author Mathieu Faverge * @author Florent Pruvost * @date 2014-11-16 * @precisions normal z -> c d s * */ #include #include "coreblas/lapacke.h" #include "coreblas/sumsq_update.h" #include "coreblas.h" /** * @brief Subcase storev == ChamColumnwise of CORE_zgessq() */ static inline int CORE_zgessq_col( int M, int N, const CHAMELEON_Complex64_t *A, int LDA, double *sclssq ) { int i, j; double tmp; double *ptr, *tmpScale, *tmpSumsq; for(j=0; j= max(1,M). * * @param[in,out] sclssq * Dimension: (2,K) * if storev == ChamColumnwise, K = N * if storev == ChamRowwise, K = M * if storev == ChamEltwise, K = 1 * On entry, sclssq contains K couples (sclssq[2*i], sclssq[2*i+1]) * which corresponds to (scale, sumsq) in the equation below * ( scl**2 )*ssq = sum( A( i, j )**2 ) + ( scale**2 )*sumsq, * respectively for the columns, the rows and the full matrix * On exit, each couple is overwritten with the final result (scl, ssq). * ******************************************************************************* * * @retval CHAMELEON_SUCCESS successful exit * @retval -k, the k-th argument had an illegal value * */ int CORE_zgessq( cham_store_t storev, int M, int N, const CHAMELEON_Complex64_t *A, int LDA, double *sclssq ) { if (storev == ChamColumnwise) { CORE_zgessq_col( M, N, A, LDA, sclssq ); } else if (storev == ChamRowwise) { CORE_zgessq_row( M, N, A, LDA, sclssq ); } else { CORE_zgessq_elt( M, N, A, LDA, sclssq ); } return CHAMELEON_SUCCESS; }