kokkos-kernels icon indicating copy to clipboard operation
kokkos-kernels copied to clipboard

Reduce duplicated code in trsv

Open jgfouca opened this issue 1 year ago • 3 comments

A slightly different for loop can avoid having to separate out the last iteration in all the uppertri functions.

jgfouca avatar Oct 17 '24 19:10 jgfouca

@cwpearson , I think it's right. The c==0 part I removed assumed there was only one item, which should hold true in both cases. Oh, it also assumed the c==0 entry is diagonal, which i also think is fine.

jgfouca avatar Oct 17 '24 23:10 jgfouca

@jgfouca we merged a fix for the failing atomics, I think if you rebase on develop the current failures will go away

cwpearson avatar Oct 21 '24 14:10 cwpearson

@lucbv , another option for the backwards loops that may be easier to read:

for (lno_t r = numRows - 1; r != static_cast<lno_t>(-1); --r) {

jgfouca avatar Oct 22 '24 15:10 jgfouca

@lucbv , see if you like the current version better.

jgfouca avatar Oct 23 '24 15:10 jgfouca

@cwpearson are you okay with this, can we merge?

lucbv avatar Oct 23 '24 21:10 lucbv