Merge pull request #4306 from angsch/develop

Improve matcopy interface
This commit is contained in:
Martin Kroeker 2023-11-11 23:19:10 +01:00 committed by GitHub
commit 00ef1bb58a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 56 additions and 48 deletions

View File

@ -100,27 +100,29 @@ void CNAME( enum CBLAS_ORDER CORDER, enum CBLAS_TRANSPOSE CTRANS, blasint crows,
if ( order == BlasColMajor) if ( order == BlasColMajor)
{ {
if ( trans == BlasNoTrans && *ldb < *rows ) info = 8; if ( trans == BlasNoTrans && *ldb < MAX(1,*rows) ) info = 8;
if ( trans == BlasTrans && *ldb < *cols ) info = 8; if ( trans == BlasTrans && *ldb < MAX(1,*cols) ) info = 8;
} }
if ( order == BlasRowMajor) if ( order == BlasRowMajor)
{ {
if ( trans == BlasNoTrans && *ldb < *cols ) info = 8; if ( trans == BlasNoTrans && *ldb < MAX(1,*cols) ) info = 8;
if ( trans == BlasTrans && *ldb < *rows ) info = 8; if ( trans == BlasTrans && *ldb < MAX(1,*rows) ) info = 8;
} }
if ( order == BlasColMajor && *lda < *rows ) info = 7; if ( order == BlasColMajor && *lda < MAX(1,*rows) ) info = 7;
if ( order == BlasRowMajor && *lda < *cols ) info = 7; if ( order == BlasRowMajor && *lda < MAX(1,*cols) ) info = 7;
if ( *cols <= 0 ) info = 4; if ( *cols < 0 ) info = 4;
if ( *rows <= 0 ) info = 3; if ( *rows < 0 ) info = 3;
if ( trans < 0 ) info = 2; if ( trans < 0 ) info = 2;
if ( order < 0 ) info = 1; if ( order < 0 ) info = 1;
if (info >= 0) { if (info >= 0) {
BLASFUNC(xerbla)(ERROR_NAME, &info, sizeof(ERROR_NAME)); BLASFUNC(xerbla)(ERROR_NAME, &info, sizeof(ERROR_NAME));
return; return;
} }
if ((*rows == 0) || (*cols == 0)) return;
#ifdef NEW_IMATCOPY #ifdef NEW_IMATCOPY
if ( *lda == *ldb ) { if ( *lda == *ldb ) {
if ( order == BlasColMajor ) if ( order == BlasColMajor )

View File

@ -90,27 +90,29 @@ void CNAME(enum CBLAS_ORDER CORDER, enum CBLAS_TRANSPOSE CTRANS, blasint crows,
#endif #endif
if ( order == BlasColMajor) if ( order == BlasColMajor)
{ {
if ( trans == BlasNoTrans && *ldb < *rows ) info = 9; if ( trans == BlasNoTrans && *ldb < MAX(1,*rows) ) info = 9;
if ( trans == BlasTrans && *ldb < *cols ) info = 9; if ( trans == BlasTrans && *ldb < MAX(1,*cols) ) info = 9;
} }
if ( order == BlasRowMajor) if ( order == BlasRowMajor)
{ {
if ( trans == BlasNoTrans && *ldb < *cols ) info = 9; if ( trans == BlasNoTrans && *ldb < MAX(1,*cols) ) info = 9;
if ( trans == BlasTrans && *ldb < *rows ) info = 9; if ( trans == BlasTrans && *ldb < MAX(1,*rows) ) info = 9;
} }
if ( order == BlasColMajor && *lda < *rows ) info = 7; if ( order == BlasColMajor && *lda < MAX(1,*rows) ) info = 7;
if ( order == BlasRowMajor && *lda < *cols ) info = 7; if ( order == BlasRowMajor && *lda < MAX(1,*cols) ) info = 7;
if ( *cols <= 0 ) info = 4; if ( *cols < 0 ) info = 4;
if ( *rows <= 0 ) info = 3; if ( *rows < 0 ) info = 3;
if ( trans < 0 ) info = 2; if ( trans < 0 ) info = 2;
if ( order < 0 ) info = 1; if ( order < 0 ) info = 1;
if (info >= 0) { if (info >= 0) {
BLASFUNC(xerbla)(ERROR_NAME, &info, sizeof(ERROR_NAME)); BLASFUNC(xerbla)(ERROR_NAME, &info, sizeof(ERROR_NAME));
return; return;
} }
if ((*rows == 0) || (*cols == 0)) return;
if ( order == BlasColMajor ) if ( order == BlasColMajor )
{ {
if ( trans == BlasNoTrans ) if ( trans == BlasNoTrans )

View File

@ -101,31 +101,33 @@ void CNAME( enum CBLAS_ORDER CORDER, enum CBLAS_TRANSPOSE CTRANS, blasint crows,
if ( order == BlasColMajor) if ( order == BlasColMajor)
{ {
if ( trans == BlasNoTrans && *ldb < *rows ) info = 9; if ( trans == BlasNoTrans && *ldb < MAX(1,*rows) ) info = 9;
if ( trans == BlasConj && *ldb < *rows ) info = 9; if ( trans == BlasConj && *ldb < MAX(1,*rows) ) info = 9;
if ( trans == BlasTrans && *ldb < *cols ) info = 9; if ( trans == BlasTrans && *ldb < MAX(1,*cols) ) info = 9;
if ( trans == BlasTransConj && *ldb < *cols ) info = 9; if ( trans == BlasTransConj && *ldb < MAX(1,*cols) ) info = 9;
} }
if ( order == BlasRowMajor) if ( order == BlasRowMajor)
{ {
if ( trans == BlasNoTrans && *ldb < *cols ) info = 9; if ( trans == BlasNoTrans && *ldb < MAX(1,*cols) ) info = 9;
if ( trans == BlasConj && *ldb < *cols ) info = 9; if ( trans == BlasConj && *ldb < MAX(1,*cols) ) info = 9;
if ( trans == BlasTrans && *ldb < *rows ) info = 9; if ( trans == BlasTrans && *ldb < MAX(1,*rows) ) info = 9;
if ( trans == BlasTransConj && *ldb < *rows ) info = 9; if ( trans == BlasTransConj && *ldb < MAX(1,*rows) ) info = 9;
} }
if ( order == BlasColMajor && *lda < *rows ) info = 7; if ( order == BlasColMajor && *lda < MAX(1,*rows) ) info = 7;
if ( order == BlasRowMajor && *lda < *cols ) info = 7; if ( order == BlasRowMajor && *lda < MAX(1,*cols) ) info = 7;
if ( *cols <= 0 ) info = 4; if ( *cols < 0 ) info = 4;
if ( *rows <= 0 ) info = 3; if ( *rows < 0 ) info = 3;
if ( trans < 0 ) info = 2; if ( trans < 0 ) info = 2;
if ( order < 0 ) info = 1; if ( order < 0 ) info = 1;
if (info >= 0) { if (info >= 0) {
BLASFUNC(xerbla)(ERROR_NAME, &info, sizeof(ERROR_NAME)); BLASFUNC(xerbla)(ERROR_NAME, &info, sizeof(ERROR_NAME));
return; return;
} }
if ((*rows == 0) || (*cols == 0)) return;
#ifdef NEW_IMATCOPY #ifdef NEW_IMATCOPY
if (*lda == *ldb ) { if (*lda == *ldb ) {
if ( order == BlasColMajor ) if ( order == BlasColMajor )

View File

@ -92,31 +92,33 @@ void CNAME(enum CBLAS_ORDER CORDER, enum CBLAS_TRANSPOSE CTRANS, blasint crows,
#endif #endif
if ( order == BlasColMajor) if ( order == BlasColMajor)
{ {
if ( trans == BlasNoTrans && *ldb < *rows ) info = 9; if ( trans == BlasNoTrans && *ldb < MAX(1,*rows) ) info = 9;
if ( trans == BlasConj && *ldb < *rows ) info = 9; if ( trans == BlasConj && *ldb < MAX(1,*rows) ) info = 9;
if ( trans == BlasTrans && *ldb < *cols ) info = 9; if ( trans == BlasTrans && *ldb < MAX(1,*cols) ) info = 9;
if ( trans == BlasTransConj && *ldb < *cols ) info = 9; if ( trans == BlasTransConj && *ldb < MAX(1,*cols) ) info = 9;
} }
if ( order == BlasRowMajor) if ( order == BlasRowMajor)
{ {
if ( trans == BlasNoTrans && *ldb < *cols ) info = 9; if ( trans == BlasNoTrans && *ldb < MAX(1,*cols) ) info = 9;
if ( trans == BlasConj && *ldb < *cols ) info = 9; if ( trans == BlasConj && *ldb < MAX(1,*cols) ) info = 9;
if ( trans == BlasTrans && *ldb < *rows ) info = 9; if ( trans == BlasTrans && *ldb < MAX(1,*rows) ) info = 9;
if ( trans == BlasTransConj && *ldb < *rows ) info = 9; if ( trans == BlasTransConj && *ldb < MAX(1,*rows) ) info = 9;
} }
if ( order == BlasColMajor && *lda < *rows ) info = 7; if ( order == BlasColMajor && *lda < MAX(1,*rows) ) info = 7;
if ( order == BlasRowMajor && *lda < *cols ) info = 7; if ( order == BlasRowMajor && *lda < MAX(1,*cols) ) info = 7;
if ( *cols <= 0 ) info = 4; if ( *cols < 0 ) info = 4;
if ( *rows <= 0 ) info = 3; if ( *rows < 0 ) info = 3;
if ( trans < 0 ) info = 2; if ( trans < 0 ) info = 2;
if ( order < 0 ) info = 1; if ( order < 0 ) info = 1;
if (info >= 0) { if (info >= 0) {
BLASFUNC(xerbla)(ERROR_NAME, &info, sizeof(ERROR_NAME)); BLASFUNC(xerbla)(ERROR_NAME, &info, sizeof(ERROR_NAME));
return; return;
} }
if ((*rows == 0) || (*cols == 0)) return;
if ( order == BlasColMajor ) if ( order == BlasColMajor )
{ {