Improve matcopy interface
* rows = 0 or cols = 0 is now a legal input and takes quick return path * Follow BLAS/LAPACK convention that the leading dimensions must be at least 1.
This commit is contained in:
parent
273f4e8794
commit
5ffbe646e1
|
@ -100,19 +100,19 @@ void CNAME( enum CBLAS_ORDER CORDER, enum CBLAS_TRANSPOSE CTRANS, blasint crows,
|
|||
|
||||
if ( order == BlasColMajor)
|
||||
{
|
||||
if ( trans == BlasNoTrans && *ldb < *rows ) info = 8;
|
||||
if ( trans == BlasTrans && *ldb < *cols ) info = 8;
|
||||
if ( trans == BlasNoTrans && *ldb < MAX(1,*rows) ) info = 8;
|
||||
if ( trans == BlasTrans && *ldb < MAX(1,*cols) ) info = 8;
|
||||
}
|
||||
if ( order == BlasRowMajor)
|
||||
{
|
||||
if ( trans == BlasNoTrans && *ldb < *cols ) info = 8;
|
||||
if ( trans == BlasTrans && *ldb < *rows ) info = 8;
|
||||
if ( trans == BlasNoTrans && *ldb < MAX(1,*cols) ) info = 8;
|
||||
if ( trans == BlasTrans && *ldb < MAX(1,*rows) ) info = 8;
|
||||
}
|
||||
|
||||
if ( order == BlasColMajor && *lda < *rows ) info = 7;
|
||||
if ( order == BlasRowMajor && *lda < *cols ) info = 7;
|
||||
if ( *cols <= 0 ) info = 4;
|
||||
if ( *rows <= 0 ) info = 3;
|
||||
if ( order == BlasColMajor && *lda < MAX(1,*rows) ) info = 7;
|
||||
if ( order == BlasRowMajor && *lda < MAX(1,*cols) ) info = 7;
|
||||
if ( *cols < 0 ) info = 4;
|
||||
if ( *rows < 0 ) info = 3;
|
||||
if ( trans < 0 ) info = 2;
|
||||
if ( order < 0 ) info = 1;
|
||||
|
||||
|
@ -121,6 +121,8 @@ void CNAME( enum CBLAS_ORDER CORDER, enum CBLAS_TRANSPOSE CTRANS, blasint crows,
|
|||
return;
|
||||
}
|
||||
|
||||
if ((*rows == 0) || (*cols == 0)) return;
|
||||
|
||||
#ifdef NEW_IMATCOPY
|
||||
if ( *lda == *ldb ) {
|
||||
if ( order == BlasColMajor )
|
||||
|
|
|
@ -90,19 +90,19 @@ void CNAME(enum CBLAS_ORDER CORDER, enum CBLAS_TRANSPOSE CTRANS, blasint crows,
|
|||
#endif
|
||||
if ( order == BlasColMajor)
|
||||
{
|
||||
if ( trans == BlasNoTrans && *ldb < *rows ) info = 9;
|
||||
if ( trans == BlasTrans && *ldb < *cols ) info = 9;
|
||||
if ( trans == BlasNoTrans && *ldb < MAX(1,*rows) ) info = 9;
|
||||
if ( trans == BlasTrans && *ldb < MAX(1,*cols) ) info = 9;
|
||||
}
|
||||
if ( order == BlasRowMajor)
|
||||
{
|
||||
if ( trans == BlasNoTrans && *ldb < *cols ) info = 9;
|
||||
if ( trans == BlasTrans && *ldb < *rows ) info = 9;
|
||||
if ( trans == BlasNoTrans && *ldb < MAX(1,*cols) ) info = 9;
|
||||
if ( trans == BlasTrans && *ldb < MAX(1,*rows) ) info = 9;
|
||||
}
|
||||
|
||||
if ( order == BlasColMajor && *lda < *rows ) info = 7;
|
||||
if ( order == BlasRowMajor && *lda < *cols ) info = 7;
|
||||
if ( *cols <= 0 ) info = 4;
|
||||
if ( *rows <= 0 ) info = 3;
|
||||
if ( order == BlasColMajor && *lda < MAX(1,*rows) ) info = 7;
|
||||
if ( order == BlasRowMajor && *lda < MAX(1,*cols) ) info = 7;
|
||||
if ( *cols < 0 ) info = 4;
|
||||
if ( *rows < 0 ) info = 3;
|
||||
if ( trans < 0 ) info = 2;
|
||||
if ( order < 0 ) info = 1;
|
||||
|
||||
|
@ -111,6 +111,8 @@ void CNAME(enum CBLAS_ORDER CORDER, enum CBLAS_TRANSPOSE CTRANS, blasint crows,
|
|||
return;
|
||||
}
|
||||
|
||||
if ((*rows == 0) || (*cols == 0)) return;
|
||||
|
||||
if ( order == BlasColMajor )
|
||||
{
|
||||
if ( trans == BlasNoTrans )
|
||||
|
|
|
@ -101,23 +101,23 @@ void CNAME( enum CBLAS_ORDER CORDER, enum CBLAS_TRANSPOSE CTRANS, blasint crows,
|
|||
|
||||
if ( order == BlasColMajor)
|
||||
{
|
||||
if ( trans == BlasNoTrans && *ldb < *rows ) info = 9;
|
||||
if ( trans == BlasConj && *ldb < *rows ) info = 9;
|
||||
if ( trans == BlasTrans && *ldb < *cols ) info = 9;
|
||||
if ( trans == BlasTransConj && *ldb < *cols ) info = 9;
|
||||
if ( trans == BlasNoTrans && *ldb < MAX(1,*rows) ) info = 9;
|
||||
if ( trans == BlasConj && *ldb < MAX(1,*rows) ) info = 9;
|
||||
if ( trans == BlasTrans && *ldb < MAX(1,*cols) ) info = 9;
|
||||
if ( trans == BlasTransConj && *ldb < MAX(1,*cols) ) info = 9;
|
||||
}
|
||||
if ( order == BlasRowMajor)
|
||||
{
|
||||
if ( trans == BlasNoTrans && *ldb < *cols ) info = 9;
|
||||
if ( trans == BlasConj && *ldb < *cols ) info = 9;
|
||||
if ( trans == BlasTrans && *ldb < *rows ) info = 9;
|
||||
if ( trans == BlasTransConj && *ldb < *rows ) info = 9;
|
||||
if ( trans == BlasNoTrans && *ldb < MAX(1,*cols) ) info = 9;
|
||||
if ( trans == BlasConj && *ldb < MAX(1,*cols) ) info = 9;
|
||||
if ( trans == BlasTrans && *ldb < MAX(1,*rows) ) info = 9;
|
||||
if ( trans == BlasTransConj && *ldb < MAX(1,*rows) ) info = 9;
|
||||
}
|
||||
|
||||
if ( order == BlasColMajor && *lda < *rows ) info = 7;
|
||||
if ( order == BlasRowMajor && *lda < *cols ) info = 7;
|
||||
if ( *cols <= 0 ) info = 4;
|
||||
if ( *rows <= 0 ) info = 3;
|
||||
if ( order == BlasColMajor && *lda < MAX(1,*rows) ) info = 7;
|
||||
if ( order == BlasRowMajor && *lda < MAX(1,*cols) ) info = 7;
|
||||
if ( *cols < 0 ) info = 4;
|
||||
if ( *rows < 0 ) info = 3;
|
||||
if ( trans < 0 ) info = 2;
|
||||
if ( order < 0 ) info = 1;
|
||||
|
||||
|
@ -126,6 +126,8 @@ void CNAME( enum CBLAS_ORDER CORDER, enum CBLAS_TRANSPOSE CTRANS, blasint crows,
|
|||
return;
|
||||
}
|
||||
|
||||
if ((*rows == 0) || (*cols == 0)) return;
|
||||
|
||||
#ifdef NEW_IMATCOPY
|
||||
if (*lda == *ldb ) {
|
||||
if ( order == BlasColMajor )
|
||||
|
|
|
@ -92,23 +92,23 @@ void CNAME(enum CBLAS_ORDER CORDER, enum CBLAS_TRANSPOSE CTRANS, blasint crows,
|
|||
#endif
|
||||
if ( order == BlasColMajor)
|
||||
{
|
||||
if ( trans == BlasNoTrans && *ldb < *rows ) info = 9;
|
||||
if ( trans == BlasConj && *ldb < *rows ) info = 9;
|
||||
if ( trans == BlasTrans && *ldb < *cols ) info = 9;
|
||||
if ( trans == BlasTransConj && *ldb < *cols ) info = 9;
|
||||
if ( trans == BlasNoTrans && *ldb < MAX(1,*rows) ) info = 9;
|
||||
if ( trans == BlasConj && *ldb < MAX(1,*rows) ) info = 9;
|
||||
if ( trans == BlasTrans && *ldb < MAX(1,*cols) ) info = 9;
|
||||
if ( trans == BlasTransConj && *ldb < MAX(1,*cols) ) info = 9;
|
||||
}
|
||||
if ( order == BlasRowMajor)
|
||||
{
|
||||
if ( trans == BlasNoTrans && *ldb < *cols ) info = 9;
|
||||
if ( trans == BlasConj && *ldb < *cols ) info = 9;
|
||||
if ( trans == BlasTrans && *ldb < *rows ) info = 9;
|
||||
if ( trans == BlasTransConj && *ldb < *rows ) info = 9;
|
||||
if ( trans == BlasNoTrans && *ldb < MAX(1,*cols) ) info = 9;
|
||||
if ( trans == BlasConj && *ldb < MAX(1,*cols) ) info = 9;
|
||||
if ( trans == BlasTrans && *ldb < MAX(1,*rows) ) info = 9;
|
||||
if ( trans == BlasTransConj && *ldb < MAX(1,*rows) ) info = 9;
|
||||
}
|
||||
|
||||
if ( order == BlasColMajor && *lda < *rows ) info = 7;
|
||||
if ( order == BlasRowMajor && *lda < *cols ) info = 7;
|
||||
if ( *cols <= 0 ) info = 4;
|
||||
if ( *rows <= 0 ) info = 3;
|
||||
if ( order == BlasColMajor && *lda < MAX(1,*rows) ) info = 7;
|
||||
if ( order == BlasRowMajor && *lda < MAX(1,*cols) ) info = 7;
|
||||
if ( *cols < 0 ) info = 4;
|
||||
if ( *rows < 0 ) info = 3;
|
||||
if ( trans < 0 ) info = 2;
|
||||
if ( order < 0 ) info = 1;
|
||||
|
||||
|
@ -117,6 +117,8 @@ void CNAME(enum CBLAS_ORDER CORDER, enum CBLAS_TRANSPOSE CTRANS, blasint crows,
|
|||
return;
|
||||
}
|
||||
|
||||
if ((*rows == 0) || (*cols == 0)) return;
|
||||
|
||||
if ( order == BlasColMajor )
|
||||
{
|
||||
|
||||
|
|
Loading…
Reference in New Issue