Skip to content

Commit 81be7cd

Browse files
author
bragadeesh
committed
bug fix for length 1
1 parent dc663b6 commit 81be7cd

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/library/generator.stockham.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1347,7 +1347,7 @@ namespace StockhamGenerator
13471347
std::string oddpadd = oddp ? " (me/2) + " : " ";
13481348

13491349
std::string idxStr, idxStrRev;
1350-
if((length == 2) || ((length & (length - 1)) != 0))
1350+
if((length <= 2) || ((length & (length - 1)) != 0))
13511351
{
13521352
idxStr += SztToStr(bid); idxStr += "*me +"; idxStr += oddpadd; idxStr += SztToStr(lid);
13531353
}
@@ -1468,7 +1468,7 @@ namespace StockhamGenerator
14681468
if(fwd)
14691469
{
14701470
std::string idxStr, idxStrRev;
1471-
if((length == 2) || ((length & (length - 1)) != 0))
1471+
if((length <= 2) || ((length & (length - 1)) != 0))
14721472
{
14731473
idxStr += SztToStr(length/(2*workGroupSize)); idxStr += "*me +"; idxStr += oddpadd; idxStr += SztToStr(lid);
14741474
}
@@ -1541,7 +1541,7 @@ namespace StockhamGenerator
15411541
else
15421542
{
15431543
std::string idxStr, idxStrRev;
1544-
if((length == 2) || ((length & (length - 1)) != 0))
1544+
if((length <= 2) || ((length & (length - 1)) != 0))
15451545
{
15461546
idxStr += SztToStr(bid); idxStr += "*me +"; idxStr += oddpadd; idxStr += SztToStr(lid);
15471547
}

0 commit comments

Comments
 (0)