Skip to content

Commit a83a2c3

Browse files
committed
Support bivalent on non-AVX
1 parent 44bdba1 commit a83a2c3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

jsrc/cip.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1128,6 +1128,8 @@ DF1(jtludecompg){F1PREFIP;PROLOG(823);
11281128
// the ith element of the permutation is the original row of row i of LU
11291129
// Bivalent. a, if given, is the sequence of thresholds to try
11301130
DF2(jtludecomp){F1PREFIP;PROLOG(823);
1131+
static D pthresh[2]={1e-6,0}, *pivotthresh; I npivotthresh, curpivotthreshx=0; // list of successive thresholds for pivots, last one usually 0.0
1132+
if(AT(w)&NOUN){ASSERT(AR(a)<=1,EVRANK); ASSERT(AN(a)>0,EVLENGTH) if(unlikely(!(AT(a)&FL)))RZ(a=cvt(FL,a)); pivotthresh=DAV(a); npivotthresh=AN(a);}else{w=a; pivotthresh=pthresh; npivotthresh=sizeof(pthresh)/sizeof(pthresh[0]);}
11311133
#if C_AVX2 || EMU_AVX2
11321134
// We operate on 4x4 blocks of A, which we transform into 4x4 blocks of LU. The ravel of each LU block is stored for cache ease,
11331135
// and the U blocks are ordered in transpose form to speed up the dot-product operations.
@@ -1140,8 +1142,6 @@ DF2(jtludecomp){F1PREFIP;PROLOG(823);
11401142
#define LGBLKSZ 2 // lg(BLKSZ)
11411143
I nzeroblocks=0; // number of zero blocks created. If negative, we have given up on zero blocks
11421144
B lookfor0blocks; // set if we think it's worthwhile to check for sparse array
1143-
static D pthresh[2]={1e-6,0}, *pivotthresh; I npivotthresh, curpivotthreshx=0; // list of successive thresholds for pivots, last one usually 0.0
1144-
if(AT(w)&NOUN){ASSERT(AR(a)<=1,EVRANK); ASSERT(AN(a)>0,EVLENGTH) if(unlikely(!(AT(a)&FL)))RZ(a=cvt(FL,a)); pivotthresh=DAV(a); npivotthresh=AN(a);}else{w=a; pivotthresh=pthresh; npivotthresh=sizeof(pthresh)/sizeof(pthresh[0]);}
11451145
ASSERT(AR(w)>=2,EVRANK); // require rank>=2
11461146
ASSERT(AS(w)[0]==AS(w)[1],EVLENGTH); // matrix must be square
11471147
if((AT(w)&SPARSE+B01+INT+FL)<=0)R jtludecompg(jt,w,DUMMYSELF); // if not real float type, use general version

0 commit comments

Comments
 (0)