PYMIC_KERNEL void mic_syrk(const int64_t *dtype, const void *A_, void *C_, const int64_t *n, const int64_t *k, const int64_t *ldc, const void *alpha_, const void *beta_) { switch(*dtype) { case DTYPE_FLOAT: { const double *A = (const double *) A_; double *C = (double *) C_; const double *alpha = (const double *) alpha_; const double *beta = (const double *) beta_; cblas_dsyrk(CblasColMajor, CblasUpper, CblasTrans, *n, *k, *alpha, A, *k, *beta, C, *ldc); } break; case DTYPE_COMPLEX: { const double complex *A = (const double complex *) A_; double complex *C = (double complex *) C_; const double complex *alpha = (const double complex *) alpha_; const double complex *beta = (const double complex *) beta_; cblas_zsyrk(CblasColMajor, CblasUpper, CblasTrans, *n, *k, alpha, A, *k, beta, C, *ldc); } break; } }
inline void syrk (CBLAS_ORDER const Order, CBLAS_UPLO const Uplo, CBLAS_TRANSPOSE const Trans, int const N, int const K, double const alpha, double const* A, int const lda, double const beta, double* C, int const ldc) { cblas_dsyrk (Order, Uplo, Trans, N, K, alpha, A, lda, beta, C, ldc); }
int check_orthogonality(int M, int N, int LDQ, double *Q) { double alpha, beta; double normQ; int info_ortho; int i; int minMN = min(M, N); double eps; double *work = (double *)malloc(minMN*sizeof(double)); eps = LAPACKE_dlamch_work('e'); alpha = 1.0; beta = -1.0; /* Build the idendity matrix USE DLASET?*/ double *Id = (double *) malloc(minMN*minMN*sizeof(double)); memset((void*)Id, 0, minMN*minMN*sizeof(double)); for (i = 0; i < minMN; i++) Id[i*minMN+i] = (double)1.0; /* Perform Id - Q'Q */ if (M >= N) cblas_dsyrk(CblasColMajor, CblasUpper, CblasTrans, N, M, alpha, Q, LDQ, beta, Id, N); else cblas_dsyrk(CblasColMajor, CblasUpper, CblasNoTrans, M, N, alpha, Q, LDQ, beta, Id, M); normQ = LAPACKE_dlansy_work(LAPACK_COL_MAJOR, lapack_const(PlasmaInfNorm), 'u', minMN, Id, minMN, work); printf("============\n"); printf("Checking the orthogonality of Q \n"); printf("||Id-Q'*Q||_oo / (N*eps) = %e \n",normQ/(minMN*eps)); if ( isnan(normQ / (minMN * eps)) || (normQ / (minMN * eps) > 10.0) ) { printf("-- Orthogonality is suspicious ! \n"); info_ortho=1; } else { printf("-- Orthogonality is CORRECT ! \n"); info_ortho=0; } free(work); free(Id); return info_ortho; }
void My_dsyrk(const enum CBLAS_UPLO Uplo,const enum CBLAS_TRANSPOSE Trans, double alpha, const gsl_matrix * A, double beta, gsl_matrix * C) { int K; if (Trans == CblasNoTrans) K = A->size2; else K = A->size1; int N = C->size1; cblas_dsyrk(CblasRowMajor, Uplo, Trans, N, K, alpha, A->data, A->tda, beta, C->data, C->tda); }
// Performs symmetric rank-k update of the submatrix. // Input to this step is the given submatrix and the output of the previous step. int S3_compute::execute(const triple & t, cholesky_context & c ) const { tile_const_ptr_type A_block; tile_const_ptr_type L1_block; tile_const_ptr_type L2_block; double temp; int b = c.b; const int k = t[0]; const int j = t[1]; const int i = t[2]; assert( j != k && i != k ); c.Lkji.get(triple(k, j, i), A_block); // Get the input tile. if(i==j) { // Diagonal tile. c.Lkji.get(triple(k+1,j,k), L2_block); // In case of a diagonal tile, i=j, hence both the tiles are the same. } else { // Non-diagonal tile. c.Lkji.get(triple(k+1,i,k), L2_block); // Get the first tile. c.Lkji.get(triple(k+1,j,k), L1_block); // Get the second tile. } #ifdef USE_MKL const double alpha = -1; const double beta = 1; if(i==j) { // Diagonal tile. cblas_dsyrk( CblasColMajor, CblasLower, CblasNoTrans, b, b, alpha, L2_block->get_array(), b, beta, const_cast< double* >( A_block->get_array() ), b ); } else { cblas_dgemm( CblasColMajor, CblasNoTrans, CblasTrans, b, b, b, alpha, L1_block->get_array(), b, L2_block->get_array(), b, beta, const_cast< double* >( A_block->get_array() ), b ); } #else for(int j_b = 0; j_b < b; j_b++) { for(int k_b = 0; k_b < b; k_b++) { temp = -1 * (*L2_block)( j_b, k_b ); if(i!=j) { for(int i_b = 0; i_b < b; i_b++) { const_cast< tile_type & >(*A_block)( i_b, j_b ) = (*A_block)( i_b, j_b ) + (temp * (*L1_block)( i_b, k_b )); } } else { for(int i_b = j_b; i_b < b; i_b++) { const_cast< tile_type & >(*A_block)( i_b, j_b ) = (*A_block)( i_b, j_b ) + (temp * (*L2_block)( i_b, k_b )); } } } } #endif c.Lkji.put(triple(k+1,j,i),A_block); // Write the output at the next time step. return CnC::CNC_Success; }
JNIEXPORT void JNICALL Java_uncomplicate_neanderthal_CBLAS_dsyrk (JNIEnv *env, jclass clazz, jint Order, jint Uplo, jint Trans, jint N, jint K, jdouble alpha, jobject A, jint offsetA, jint lda, jfloat beta, jobject C, jint offsetC, jint ldc) { double *cA = (double *) (*env)->GetDirectBufferAddress(env, A); double *cC = (double *) (*env)->GetDirectBufferAddress(env, C); cblas_dsyrk(Order, Uplo, Trans, N, K, alpha, cA + offsetA, lda, beta, cC + offsetC, ldc); };
/*------------------------------------------------------------------- * Check the orthogonality of Q */ static int check_orthogonality(int M, int N, double *Q, int LDQ, double eps) { double alpha = 1.0; double beta = -1.0; double normQ, result; int info_ortho; int minMN = min(M, N); double *work = (double *)malloc(minMN*sizeof(double)); /* Build the idendity matrix */ double *Id = (double *) malloc(minMN*minMN*sizeof(double)); LAPACKE_dlaset_work(LAPACK_COL_MAJOR, 'A', minMN, minMN, 0., 1., Id, minMN); /* Perform Id - Q'Q */ if (M >= N) cblas_dsyrk(CblasColMajor, CblasUpper, CblasTrans, N, M, alpha, Q, LDQ, beta, Id, N); else cblas_dsyrk(CblasColMajor, CblasUpper, CblasNoTrans, M, N, alpha, Q, LDQ, beta, Id, M); normQ = LAPACKE_dlansy_work(LAPACK_COL_MAJOR, lapack_const(PlasmaInfNorm), 'U', minMN, Id, minMN, work); result = normQ / (minMN * eps); printf("============\n"); printf("Checking the orthogonality of Q \n"); printf("||Id-Q'*Q||_oo / (minMN*eps) = %e \n", result); if ( isnan(result) || isinf(result) || (result > 60.0) ) { printf("-- Orthogonality is suspicious ! \n"); info_ortho=1; } else { printf("-- Orthogonality is CORRECT ! \n"); info_ortho=0; } free(work); free(Id); return info_ortho; }
static int check_solution(PLASMA_enum uplo, PLASMA_enum trans, int N, int K, double alpha, double *A, int LDA, double beta, double *Cref, double *Cplasma, int LDC) { int info_solution; double Anorm, Cinitnorm, Cplasmanorm, Clapacknorm, Rnorm; double eps; double beta_const; double result; double *work = (double *)malloc(max(N, K)* sizeof(double)); beta_const = -1.0; Anorm = LAPACKE_dlange_work(LAPACK_COL_MAJOR, lapack_const(PlasmaInfNorm), (trans == PlasmaNoTrans) ? N : K, (trans == PlasmaNoTrans) ? K : N, A, LDA, work); Cinitnorm = LAPACKE_dlange_work(LAPACK_COL_MAJOR, lapack_const(PlasmaInfNorm), N, N, Cref, LDC, work); Cplasmanorm = LAPACKE_dlange_work(LAPACK_COL_MAJOR, lapack_const(PlasmaInfNorm), N, N, Cplasma, LDC, work); cblas_dsyrk(CblasColMajor, (CBLAS_UPLO)uplo, (CBLAS_TRANSPOSE)trans, N, K, (alpha), A, LDA, (beta), Cref, LDC); Clapacknorm = LAPACKE_dlange_work(LAPACK_COL_MAJOR, lapack_const(PlasmaInfNorm), N, N, Cref, LDC, work); cblas_daxpy(LDC*N, (beta_const), Cplasma, 1, Cref, 1); Rnorm = LAPACKE_dlange_work(LAPACK_COL_MAJOR, lapack_const(PlasmaInfNorm), N, N, Cref, LDC, work); eps = LAPACKE_dlamch_work('e'); printf("Rnorm %e, Anorm %e, Cinitnorm %e, Cplasmanorm %e, Clapacknorm %e\n", Rnorm, Anorm, Cinitnorm, Cplasmanorm, Clapacknorm); result = Rnorm / ((Anorm + Cinitnorm) * N * eps); printf("============\n"); printf("Checking the norm of the difference against reference DSYRK \n"); printf("-- ||Cplasma - Clapack||_oo/((||A||_oo+||C||_oo).N.eps) = %e \n", result); if ( isinf(Clapacknorm) || isinf(Cplasmanorm) || isnan(result) || isinf(result) || (result > 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; }
int main(int argc, char **argv) { std::string interleaving; if (argc > 1) { interleaving = argv[1]; } else { interleaving = ""; } FILE *f = fopen("syrk.csv","a"); int n = 1024; double *C = (double*) malloc(n * n * sizeof(double)); double *A = (double*) malloc(n * n * sizeof(double)); double *C2 = (double*) malloc(n * n * sizeof(double)); double *A2 = (double*) malloc(n * n * sizeof(double)); initialize(C, A, C2, A2, n); SyrkProblem* problem = new SyrkProblem(C, A, n, n, n); struct timeval start, end; gettimeofday(&start, NULL); Framework::solve(problem, interleaving); gettimeofday(&end, NULL); double seconds = (end.tv_sec - start.tv_sec) + 1.0e-6 * (end.tv_usec - start.tv_usec); #ifdef DEBUG fprintf(f,"SYRK,%d,%s,%f,%ld,%ld\n", n, interleaving.c_str(), seconds, Memory::getMax(), Memory::getTotal()); printf("SYRK,%d,%s,%f,%ld,%ld\n", n, interleaving.c_str(), seconds, Memory::getMax(), Memory::getTotal()); #else fprintf(f,"SYRK,%d,%s,%f\n", n, interleaving.c_str(), seconds); printf("SYRK,%d,%s,%f\n", n, interleaving.c_str(), seconds); #endif // Correctness cblas_dsyrk(CblasColMajor, CblasLower, CblasNoTrans, n, n, -1.0, A2, n, 1.0, C2, n); for(int i = 0; i < n*n; i++) { if ((fabs(C[i] - C2[i]) / C[i]) > .0000000001) { printf("ERROR: %f\n", fabs((C[i] - C2[i]) / C[i])); exit(EXIT_FAILURE); } } printf("test passed\n"); free(C); free(A); free(C2); free(A2); delete problem; fclose(f); }
// This task performs a symmetric rank-k update, which is the // third step in the tiled Cholesky factorization ocrGuid_t cblas_dsyrk_task ( u32 paramc, u64* paramv, u32 depc, ocrEdtDep_t depv[]) { u64 *func_args = paramv; u32 k = (u32) func_args[0]; u32 j = (u32) func_args[1]; u32 i = (u32) func_args[2]; u32 tileSize = (u32) func_args[3]; ocrGuid_t out_lkji_jjkp1_event_guid = (ocrGuid_t) func_args[4]; // PRINTF("RUNNING update_diagonal (%d, %d, %d)\n", k, j, i); double* aBlock = (double*) (depv[0].ptr); double* l2Block = (double*) (depv[1].ptr); // Symmetric Rank-k Update C = alpha AA' + beta C, where alpha = -1, beta = 1 cblas_dsyrk(CblasRowMajor, CblasLower, CblasNoTrans, tileSize, tileSize, -1.0, l2Block, tileSize, 1.0, // A matrix aBlock, tileSize); // C matrix, solution put here in lower triangle ocrEventSatisfy(out_lkji_jjkp1_event_guid, depv[0].guid); return NULL_GUID; }
void SyrkProblem::runBaseCase() { cblas_dsyrk(CblasColMajor, CblasLower, CblasNoTrans, n, n, -1.0, A, lda, 1.0, C, ldc); }
void wrapper_cblas_dsyrk(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo, const enum CBLAS_TRANSPOSE Trans, const int N, const int K, const double alpha, const double *A, const int lda, const double beta, double *C, const int ldc) { cblas_dsyrk(Order, Uplo, Trans, N, K, alpha, A, lda, beta, C, ldc); }
inline void herk( const Order order, const UpLo uplo, const Trans trans, const int n, const int k, const double alpha, const double* a, const int lda, const double beta, double* c, const int ldc ) { cblas_dsyrk( cblas_option< Order >::value, cblas_option< UpLo >::value, cblas_option< Trans >::value, n, k, alpha, a, lda, beta, c, ldc ); }
void test_syrk (void) { const double flteps = 1e-4, dbleps = 1e-6; { int order = 101; int uplo = 121; int trans = 111; int N = 2; int K = 1; float alpha = -1.0f; float beta = 0.1f; float A[] = { 0.412f, -0.229f }; int lda = 1; float C[] = { 0.628f, -0.664f, -0.268f, 0.096f }; int ldc = 2; float C_expected[] = { -0.106944f, 0.027948f, -0.268f, -0.042841f }; cblas_ssyrk(order, uplo, trans, N, K, alpha, A, lda, beta, C, ldc); { int i; for (i = 0; i < 4; i++) { gsl_test_rel(C[i], C_expected[i], flteps, "ssyrk(case 1566)"); } }; }; { int order = 102; int uplo = 121; int trans = 111; int N = 2; int K = 1; float alpha = -1.0f; float beta = 0.1f; float A[] = { 0.101f, -0.653f }; int lda = 2; float C[] = { 0.432f, 0.107f, -0.952f, -0.532f }; int ldc = 2; float C_expected[] = { 0.032999f, 0.107f, -0.029247f, -0.479609f }; cblas_ssyrk(order, uplo, trans, N, K, alpha, A, lda, beta, C, ldc); { int i; for (i = 0; i < 4; i++) { gsl_test_rel(C[i], C_expected[i], flteps, "ssyrk(case 1567)"); } }; }; { int order = 101; int uplo = 121; int trans = 112; int N = 2; int K = 1; float alpha = 1.0f; float beta = 0.1f; float A[] = { 0.79f, 0.595f }; int lda = 2; float C[] = { 0.257f, 0.183f, -0.021f, -0.053f }; int ldc = 2; float C_expected[] = { 0.6498f, 0.48835f, -0.021f, 0.348725f }; cblas_ssyrk(order, uplo, trans, N, K, alpha, A, lda, beta, C, ldc); { int i; for (i = 0; i < 4; i++) { gsl_test_rel(C[i], C_expected[i], flteps, "ssyrk(case 1568)"); } }; }; { int order = 102; int uplo = 121; int trans = 112; int N = 2; int K = 1; float alpha = 1.0f; float beta = 0.1f; float A[] = { -0.181f, -0.654f }; int lda = 1; float C[] = { -0.4f, 0.615f, 0.147f, -0.163f }; int ldc = 2; float C_expected[] = { -0.007239f, 0.615f, 0.133074f, 0.411416f }; cblas_ssyrk(order, uplo, trans, N, K, alpha, A, lda, beta, C, ldc); { int i; for (i = 0; i < 4; i++) { gsl_test_rel(C[i], C_expected[i], flteps, "ssyrk(case 1569)"); } }; }; { int order = 101; int uplo = 122; int trans = 111; int N = 2; int K = 1; float alpha = 0.0f; float beta = -1.0f; float A[] = { -0.191f, 0.584f }; int lda = 1; float C[] = { -0.719f, -0.681f, -0.003f, 0.544f }; int ldc = 2; float C_expected[] = { 0.719f, -0.681f, 0.003f, -0.544f }; cblas_ssyrk(order, uplo, trans, N, K, alpha, A, lda, beta, C, ldc); { int i; for (i = 0; i < 4; i++) { gsl_test_rel(C[i], C_expected[i], flteps, "ssyrk(case 1570)"); } }; }; { int order = 102; int uplo = 122; int trans = 111; int N = 2; int K = 1; float alpha = 0.0f; float beta = -1.0f; float A[] = { 0.788f, 0.041f }; int lda = 2; float C[] = { 0.029f, 0.365f, 0.739f, -0.769f }; int ldc = 2; float C_expected[] = { -0.029f, -0.365f, 0.739f, 0.769f }; cblas_ssyrk(order, uplo, trans, N, K, alpha, A, lda, beta, C, ldc); { int i; for (i = 0; i < 4; i++) { gsl_test_rel(C[i], C_expected[i], flteps, "ssyrk(case 1571)"); } }; }; { int order = 101; int uplo = 122; int trans = 112; int N = 2; int K = 1; float alpha = -0.3f; float beta = -1.0f; float A[] = { 0.733f, 0.678f }; int lda = 2; float C[] = { -0.941f, 0.96f, 0.07f, -0.295f }; int ldc = 2; float C_expected[] = { 0.779813f, 0.96f, -0.219092f, 0.157095f }; cblas_ssyrk(order, uplo, trans, N, K, alpha, A, lda, beta, C, ldc); { int i; for (i = 0; i < 4; i++) { gsl_test_rel(C[i], C_expected[i], flteps, "ssyrk(case 1572)"); } }; }; { int order = 102; int uplo = 122; int trans = 112; int N = 2; int K = 1; float alpha = -0.3f; float beta = -1.0f; float A[] = { -0.87f, 0.675f }; int lda = 1; float C[] = { -0.602f, -0.432f, -0.984f, 0.384f }; int ldc = 2; float C_expected[] = { 0.37493f, 0.608175f, -0.984f, -0.520687f }; cblas_ssyrk(order, uplo, trans, N, K, alpha, A, lda, beta, C, ldc); { int i; for (i = 0; i < 4; i++) { gsl_test_rel(C[i], C_expected[i], flteps, "ssyrk(case 1573)"); } }; }; { int order = 101; int uplo = 121; int trans = 111; int N = 2; int K = 1; double alpha = 0.1; double beta = -0.3; double A[] = { 0.169, -0.875 }; int lda = 1; double C[] = { 0.159, 0.277, 0.865, 0.346 }; int ldc = 2; double C_expected[] = { -0.0448439, -0.0978875, 0.865, -0.0272375 }; cblas_dsyrk(order, uplo, trans, N, K, alpha, A, lda, beta, C, ldc); { int i; for (i = 0; i < 4; i++) { gsl_test_rel(C[i], C_expected[i], dbleps, "dsyrk(case 1574)"); } }; }; { int order = 102; int uplo = 121; int trans = 111; int N = 2; int K = 1; double alpha = 0.1; double beta = -0.3; double A[] = { 0.536, -0.725 }; int lda = 2; double C[] = { 0.154, -0.445, -0.841, -0.91 }; int ldc = 2; double C_expected[] = { -0.0174704, -0.445, 0.21344, 0.3255625 }; cblas_dsyrk(order, uplo, trans, N, K, alpha, A, lda, beta, C, ldc); { int i; for (i = 0; i < 4; i++) { gsl_test_rel(C[i], C_expected[i], dbleps, "dsyrk(case 1575)"); } }; }; { int order = 101; int uplo = 121; int trans = 112; int N = 2; int K = 1; double alpha = 0; double beta = -1; double A[] = { -0.07, 0.8 }; int lda = 2; double C[] = { 0.823, -0.88, -0.136, 0.793 }; int ldc = 2; double C_expected[] = { -0.823, 0.88, -0.136, -0.793 }; cblas_dsyrk(order, uplo, trans, N, K, alpha, A, lda, beta, C, ldc); { int i; for (i = 0; i < 4; i++) { gsl_test_rel(C[i], C_expected[i], dbleps, "dsyrk(case 1576)"); } }; }; { int order = 102; int uplo = 121; int trans = 112; int N = 2; int K = 1; double alpha = 0; double beta = -1; double A[] = { -0.058, 0.649 }; int lda = 1; double C[] = { -0.187, 0.294, -0.004, -0.933 }; int ldc = 2; double C_expected[] = { 0.187, 0.294, 0.004, 0.933 }; cblas_dsyrk(order, uplo, trans, N, K, alpha, A, lda, beta, C, ldc); { int i; for (i = 0; i < 4; i++) { gsl_test_rel(C[i], C_expected[i], dbleps, "dsyrk(case 1577)"); } }; }; { int order = 101; int uplo = 122; int trans = 111; int N = 2; int K = 1; double alpha = 1; double beta = -1; double A[] = { 0.263, -0.289 }; int lda = 1; double C[] = { 0.554, -0.679, 0.993, 0.758 }; int ldc = 2; double C_expected[] = { -0.484831, -0.679, -1.069007, -0.674479 }; cblas_dsyrk(order, uplo, trans, N, K, alpha, A, lda, beta, C, ldc); { int i; for (i = 0; i < 4; i++) { gsl_test_rel(C[i], C_expected[i], dbleps, "dsyrk(case 1578)"); } }; }; { int order = 102; int uplo = 122; int trans = 111; int N = 2; int K = 1; double alpha = 1; double beta = -1; double A[] = { -0.265, -0.837 }; int lda = 2; double C[] = { -0.994, 0.967, -0.34, -0.069 }; int ldc = 2; double C_expected[] = { 1.064225, -0.745195, -0.34, 0.769569 }; cblas_dsyrk(order, uplo, trans, N, K, alpha, A, lda, beta, C, ldc); { int i; for (i = 0; i < 4; i++) { gsl_test_rel(C[i], C_expected[i], dbleps, "dsyrk(case 1579)"); } }; }; { int order = 101; int uplo = 122; int trans = 112; int N = 2; int K = 1; double alpha = -0.3; double beta = 1; double A[] = { -0.464, 0.394 }; int lda = 2; double C[] = { -0.45, -0.447, 0.649, 0.055 }; int ldc = 2; double C_expected[] = { -0.5145888, -0.447, 0.7038448, 0.0084292 }; cblas_dsyrk(order, uplo, trans, N, K, alpha, A, lda, beta, C, ldc); { int i; for (i = 0; i < 4; i++) { gsl_test_rel(C[i], C_expected[i], dbleps, "dsyrk(case 1580)"); } }; }; { int order = 102; int uplo = 122; int trans = 112; int N = 2; int K = 1; double alpha = -0.3; double beta = 1; double A[] = { 0.815, 0.168 }; int lda = 1; double C[] = { 0.817, -0.957, -0.395, -0.382 }; int ldc = 2; double C_expected[] = { 0.6177325, -0.998076, -0.395, -0.3904672 }; cblas_dsyrk(order, uplo, trans, N, K, alpha, A, lda, beta, C, ldc); { int i; for (i = 0; i < 4; i++) { gsl_test_rel(C[i], C_expected[i], dbleps, "dsyrk(case 1581)"); } }; }; { int order = 101; int uplo = 121; int trans = 111; int N = 2; int K = 1; float alpha[2] = {0.0f, 0.0f}; float beta[2] = {-0.3f, 0.1f}; float A[] = { 0.447f, -0.507f, -0.425f, 0.701f }; int lda = 1; float C[] = { 0.16f, -0.245f, 0.922f, -0.437f, 0.24f, 0.008f, -0.095f, 0.749f }; int ldc = 2; float C_expected[] = { -0.0235f, 0.0895f, -0.2329f, 0.2233f, 0.24f, 0.008f, -0.0464f, -0.2342f }; cblas_csyrk(order, uplo, trans, N, K, alpha, A, lda, beta, C, ldc); { int i; for (i = 0; i < 4; i++) { gsl_test_rel(C[2*i], C_expected[2*i], flteps, "csyrk(case 1582) real"); gsl_test_rel(C[2*i+1], C_expected[2*i+1], flteps, "csyrk(case 1582) imag"); }; }; }; { int order = 102; int uplo = 121; int trans = 111; int N = 2; int K = 1; float alpha[2] = {0.0f, 0.0f}; float beta[2] = {-0.3f, 0.1f}; float A[] = { -0.421f, -0.435f, -0.914f, -0.493f }; int lda = 2; float C[] = { -0.761f, -0.38f, 0.043f, -0.999f, 0.779f, 0.238f, 0.082f, 0.394f }; int ldc = 2; float C_expected[] = { 0.2663f, 0.0379f, 0.043f, -0.999f, -0.2575f, 0.0065f, -0.064f, -0.11f }; cblas_csyrk(order, uplo, trans, N, K, alpha, A, lda, beta, C, ldc); { int i; for (i = 0; i < 4; i++) { gsl_test_rel(C[2*i], C_expected[2*i], flteps, "csyrk(case 1583) real"); gsl_test_rel(C[2*i+1], C_expected[2*i+1], flteps, "csyrk(case 1583) imag"); }; }; }; { int order = 101; int uplo = 121; int trans = 112; int N = 2; int K = 1; float alpha[2] = {-1.0f, 0.0f}; float beta[2] = {-0.3f, 0.1f}; float A[] = { 0.827f, -0.896f, 0.417f, 0.865f }; int lda = 2; float C[] = { -0.349f, -0.31f, 0.972f, 0.794f, -0.906f, -0.595f, -0.089f, -0.333f }; int ldc = 2; float C_expected[] = { 0.254587f, 1.54008f, -1.4909f, -0.482723f, -0.906f, -0.595f, 0.634336f, -0.63041f }; cblas_csyrk(order, uplo, trans, N, K, alpha, A, lda, beta, C, ldc); { int i; for (i = 0; i < 4; i++) { gsl_test_rel(C[2*i], C_expected[2*i], flteps, "csyrk(case 1584) real"); gsl_test_rel(C[2*i+1], C_expected[2*i+1], flteps, "csyrk(case 1584) imag"); }; }; }; { int order = 102; int uplo = 121; int trans = 112; int N = 2; int K = 1; float alpha[2] = {-1.0f, 0.0f}; float beta[2] = {-0.3f, 0.1f}; float A[] = { 0.607f, 0.747f, -0.889f, 0.333f }; int lda = 1; float C[] = { 0.244f, 0.564f, 0.009f, 0.578f, -0.827f, 0.558f, -0.337f, 0.731f }; int ldc = 2; float C_expected[] = { 0.05996f, -1.05166f, 0.009f, 0.578f, 0.980674f, 0.211852f, -0.651432f, 0.339074f }; cblas_csyrk(order, uplo, trans, N, K, alpha, A, lda, beta, C, ldc); { int i; for (i = 0; i < 4; i++) { gsl_test_rel(C[2*i], C_expected[2*i], flteps, "csyrk(case 1585) real"); gsl_test_rel(C[2*i+1], C_expected[2*i+1], flteps, "csyrk(case 1585) imag"); }; }; }; { int order = 101; int uplo = 122; int trans = 111; int N = 2; int K = 1; float alpha[2] = {1.0f, 0.0f}; float beta[2] = {0.0f, 1.0f}; float A[] = { 0.784f, -0.281f, -0.88f, 0.479f }; int lda = 1; float C[] = { 0.491f, 0.531f, 0.805f, -0.097f, 0.728f, 0.674f, -0.705f, -0.754f }; int ldc = 2; float C_expected[] = { 0.004695f, 0.050392f, 0.805f, -0.097f, -1.22932f, 1.35082f, 1.29896f, -1.54804f }; cblas_csyrk(order, uplo, trans, N, K, alpha, A, lda, beta, C, ldc); { int i; for (i = 0; i < 4; i++) { gsl_test_rel(C[2*i], C_expected[2*i], flteps, "csyrk(case 1586) real"); gsl_test_rel(C[2*i+1], C_expected[2*i+1], flteps, "csyrk(case 1586) imag"); }; }; }; { int order = 102; int uplo = 122; int trans = 111; int N = 2; int K = 1; float alpha[2] = {1.0f, 0.0f}; float beta[2] = {0.0f, 1.0f}; float A[] = { 0.272f, -0.146f, 0.155f, 0.038f }; int lda = 2; float C[] = { 0.533f, -0.41f, -0.904f, 0.301f, -0.836f, 0.57f, -0.374f, -0.293f }; int ldc = 2; float C_expected[] = { 0.462668f, 0.453576f, -0.253292f, -0.916294f, -0.836f, 0.57f, 0.315581f, -0.36222f }; cblas_csyrk(order, uplo, trans, N, K, alpha, A, lda, beta, C, ldc); { int i; for (i = 0; i < 4; i++) { gsl_test_rel(C[2*i], C_expected[2*i], flteps, "csyrk(case 1587) real"); gsl_test_rel(C[2*i+1], C_expected[2*i+1], flteps, "csyrk(case 1587) imag"); }; }; }; { int order = 101; int uplo = 122; int trans = 112; int N = 2; int K = 1; float alpha[2] = {0.0f, 1.0f}; float beta[2] = {-1.0f, 0.0f}; float A[] = { -0.055f, -0.127f, -0.896f, -0.625f }; int lda = 2; float C[] = { -0.619f, 0.511f, -0.877f, 0.557f, -0.801f, -0.437f, -0.922f, 0.332f }; int ldc = 2; float C_expected[] = { 0.60503f, -0.524104f, -0.877f, 0.557f, 0.652833f, 0.406905f, -0.198f, 0.080191f }; cblas_csyrk(order, uplo, trans, N, K, alpha, A, lda, beta, C, ldc); { int i; for (i = 0; i < 4; i++) { gsl_test_rel(C[2*i], C_expected[2*i], flteps, "csyrk(case 1588) real"); gsl_test_rel(C[2*i+1], C_expected[2*i+1], flteps, "csyrk(case 1588) imag"); }; }; }; { int order = 102; int uplo = 122; int trans = 112; int N = 2; int K = 1; float alpha[2] = {0.0f, 1.0f}; float beta[2] = {-1.0f, 0.0f}; float A[] = { -0.528f, 0.759f, -0.079f, 0.952f }; int lda = 1; float C[] = { 0.775f, 0.855f, 0.786f, 0.525f, 0.85f, 0.044f, 0.658f, 0.947f }; int ldc = 2; float C_expected[] = { 0.026504f, -1.1523f, -0.223383f, -1.20586f, 0.85f, 0.044f, -0.507584f, -1.84706f }; cblas_csyrk(order, uplo, trans, N, K, alpha, A, lda, beta, C, ldc); { int i; for (i = 0; i < 4; i++) { gsl_test_rel(C[2*i], C_expected[2*i], flteps, "csyrk(case 1589) real"); gsl_test_rel(C[2*i+1], C_expected[2*i+1], flteps, "csyrk(case 1589) imag"); }; }; }; { int order = 101; int uplo = 121; int trans = 111; int N = 2; int K = 1; double alpha[2] = {1, 0}; double beta[2] = {1, 0}; double A[] = { -0.049, -0.687, -0.434, 0.294 }; int lda = 1; double C[] = { 0.937, -0.113, 0.796, 0.293, 0.876, -0.199, -0.757, -0.103 }; int ldc = 2; double C_expected[] = { 0.467432, -0.045674, 1.019244, 0.576752, 0.876, -0.199, -0.65508, -0.358192 }; cblas_zsyrk(order, uplo, trans, N, K, alpha, A, lda, beta, C, ldc); { int i; for (i = 0; i < 4; i++) { gsl_test_rel(C[2*i], C_expected[2*i], dbleps, "zsyrk(case 1590) real"); gsl_test_rel(C[2*i+1], C_expected[2*i+1], dbleps, "zsyrk(case 1590) imag"); }; }; }; { int order = 102; int uplo = 121; int trans = 111; int N = 2; int K = 1; double alpha[2] = {1, 0}; double beta[2] = {1, 0}; double A[] = { 0.359, -0.364, 0.926, -0.69 }; int lda = 2; double C[] = { 0.306, 0.249, 0.28, 0.229, 0.866, 0.092, 0.886, -0.283 }; int ldc = 2; double C_expected[] = { 0.302385, -0.012352, 0.28, 0.229, 0.947274, -0.492774, 1.267376, -1.56088 }; cblas_zsyrk(order, uplo, trans, N, K, alpha, A, lda, beta, C, ldc); { int i; for (i = 0; i < 4; i++) { gsl_test_rel(C[2*i], C_expected[2*i], dbleps, "zsyrk(case 1591) real"); gsl_test_rel(C[2*i+1], C_expected[2*i+1], dbleps, "zsyrk(case 1591) imag"); }; }; }; { int order = 101; int uplo = 121; int trans = 112; int N = 2; int K = 1; double alpha[2] = {-0.3, 0.1}; double beta[2] = {0, 0}; double A[] = { 0.607, 0.555, -0.85, 0.831 }; int lda = 2; double C[] = { 0.069, 0.368, 0.551, -0.912, -0.243, -0.063, -0.924, 0.192 }; int ldc = 2; double C_expected[] = { -0.0855042, -0.1960886, 0.2898798, -0.1075156, -0.243, -0.063, 0.1316883, 0.4270039 }; cblas_zsyrk(order, uplo, trans, N, K, alpha, A, lda, beta, C, ldc); { int i; for (i = 0; i < 4; i++) { gsl_test_rel(C[2*i], C_expected[2*i], dbleps, "zsyrk(case 1592) real"); gsl_test_rel(C[2*i+1], C_expected[2*i+1], dbleps, "zsyrk(case 1592) imag"); }; }; }; { int order = 102; int uplo = 121; int trans = 112; int N = 2; int K = 1; double alpha[2] = {-0.3, 0.1}; double beta[2] = {0, 0}; double A[] = { 0.427, 0.86, -0.136, 0.002 }; int lda = 1; double C[] = { 0.398, -0.47, 0.011, -0.547, -0.106, 0.016, 0.681, 0.246 }; int ldc = 2; double C_expected[] = { 0.0937373, -0.2760591, 0.011, -0.547, 0.0295482, 0.0288526, -0.0054932, 0.0020124 }; cblas_zsyrk(order, uplo, trans, N, K, alpha, A, lda, beta, C, ldc); { int i; for (i = 0; i < 4; i++) { gsl_test_rel(C[2*i], C_expected[2*i], dbleps, "zsyrk(case 1593) real"); gsl_test_rel(C[2*i+1], C_expected[2*i+1], dbleps, "zsyrk(case 1593) imag"); }; }; }; { int order = 101; int uplo = 122; int trans = 111; int N = 2; int K = 1; double alpha[2] = {-0.3, 0.1}; double beta[2] = {1, 0}; double A[] = { 0.718, 0.023, 0.355, -0.492 }; int lda = 1; double C[] = { -0.637, -0.727, -0.475, -0.776, 0.802, -0.55, -0.837, 0.222 }; int ldc = 2; double C_expected[] = { -0.7948013, -0.6854089, -0.475, -0.776, 0.7566473, -0.4198521, -0.7672563, 0.3151921 }; cblas_zsyrk(order, uplo, trans, N, K, alpha, A, lda, beta, C, ldc); { int i; for (i = 0; i < 4; i++) { gsl_test_rel(C[2*i], C_expected[2*i], dbleps, "zsyrk(case 1594) real"); gsl_test_rel(C[2*i+1], C_expected[2*i+1], dbleps, "zsyrk(case 1594) imag"); }; }; }; { int order = 102; int uplo = 122; int trans = 111; int N = 2; int K = 1; double alpha[2] = {-0.3, 0.1}; double beta[2] = {1, 0}; double A[] = { 0.209, 0.139, -0.202, -0.223 }; int lda = 2; double C[] = { -0.695, 0.524, 0.212, -0.88, -0.752, 0.291, 0.684, -0.124 }; int ldc = 2; double C_expected[] = { -0.7081182, 0.5090054, 0.2228348, -0.8587166, -0.752, 0.291, 0.6776683, -0.1519201 }; cblas_zsyrk(order, uplo, trans, N, K, alpha, A, lda, beta, C, ldc); { int i; for (i = 0; i < 4; i++) { gsl_test_rel(C[2*i], C_expected[2*i], dbleps, "zsyrk(case 1595) real"); gsl_test_rel(C[2*i+1], C_expected[2*i+1], dbleps, "zsyrk(case 1595) imag"); }; }; }; { int order = 101; int uplo = 122; int trans = 112; int N = 2; int K = 1; double alpha[2] = {-0.3, 0.1}; double beta[2] = {1, 0}; double A[] = { -0.365, -0.624, 0.632, 0.348 }; int lda = 2; double C[] = { 0.877, 0.927, -0.377, 0.967, 0.008, 0.292, -0.779, 0.794 }; int ldc = 2; double C_expected[] = { 0.9082933, 0.7647289, -0.377, 0.967, 0.0641972, 0.4470636, -0.9064832, 0.6898704 }; cblas_zsyrk(order, uplo, trans, N, K, alpha, A, lda, beta, C, ldc); { int i; for (i = 0; i < 4; i++) { gsl_test_rel(C[2*i], C_expected[2*i], dbleps, "zsyrk(case 1596) real"); gsl_test_rel(C[2*i+1], C_expected[2*i+1], dbleps, "zsyrk(case 1596) imag"); }; }; }; { int order = 102; int uplo = 122; int trans = 112; int N = 2; int K = 1; double alpha[2] = {-0.3, 0.1}; double beta[2] = {1, 0}; double A[] = { -0.067, -0.586, 0.208, 0.331 }; int lda = 1; double C[] = { 0.584, -0.454, 0.93, 0.782, 0.489, -0.278, 0.081, -0.919 }; int ldc = 2; double C_expected[] = { 0.6778197, -0.5114479, 0.8903975, 0.8432225, 0.489, -0.278, 0.0871195, -0.9669385 }; cblas_zsyrk(order, uplo, trans, N, K, alpha, A, lda, beta, C, ldc); { int i; for (i = 0; i < 4; i++) { gsl_test_rel(C[2*i], C_expected[2*i], dbleps, "zsyrk(case 1597) real"); gsl_test_rel(C[2*i+1], C_expected[2*i+1], dbleps, "zsyrk(case 1597) imag"); }; }; }; }