Skip to content

Commit 3760481

Browse files
authored
Use in-place transform shortcut only if matrix is square
1 parent d1c5b8f commit 3760481

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

interface/zimatcopy.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,7 @@ void CNAME( enum CBLAS_ORDER CORDER, enum CBLAS_TRANSPOSE CTRANS, blasint crows,
126126
return;
127127
}
128128
#ifdef NEW_IMATCOPY
129-
if (*lda == *ldb) {
130-
fprintf(stderr," lda=ldb, new_imatcopy in place\n");
129+
if (*lda == *ldb && *cols == *rows) {
131130
if ( order == BlasColMajor )
132131
{
133132

@@ -141,7 +140,7 @@ fprintf(stderr," lda=ldb, new_imatcopy in place\n");
141140
}
142141
if ( trans == BlasTrans )
143142
{
144-
IMATCOPY_K_CT(*cols, *rows, alpha[0], alpha[1], a, *lda );
143+
IMATCOPY_K_CT(*rows, *cols, alpha[0], alpha[1], a, *lda );
145144
}
146145
if ( trans == BlasTransConj )
147146
{
@@ -161,7 +160,6 @@ fprintf(stderr," lda=ldb, new_imatcopy in place\n");
161160
}
162161
if ( trans == BlasTrans )
163162
{
164-
fprintf(stderr,"rows trans inplace\n");
165163
IMATCOPY_K_RT(*rows, *cols, alpha[0], alpha[1], a, *lda );
166164
}
167165
if ( trans == BlasTransConj )
@@ -172,7 +170,7 @@ fprintf(stderr,"rows trans inplace\n");
172170
return;
173171
}
174172
#endif
175-
fprintf(stderr,"lda: %d ldb:%d\n",*lda,*ldb);
173+
176174
if ( *lda > *ldb )
177175
msize = (*lda) * (*ldb) * sizeof(FLOAT) * 2;
178176
else
@@ -181,7 +179,7 @@ fprintf(stderr,"lda: %d ldb:%d\n",*lda,*ldb);
181179
b = malloc(msize);
182180
if ( b == NULL )
183181
{
184-
printf("Memory alloc failed\n");
182+
printf("Memory alloc failed in zimatcopy\n");
185183
exit(1);
186184
}
187185

0 commit comments

Comments
 (0)