Skip to content

Commit

Permalink
bug fix for length 1
Browse files Browse the repository at this point in the history
  • Loading branch information
bragadeesh committed Aug 7, 2015
1 parent dc663b6 commit 81be7cd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/library/generator.stockham.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1347,7 +1347,7 @@ namespace StockhamGenerator
std::string oddpadd = oddp ? " (me/2) + " : " ";

std::string idxStr, idxStrRev;
if((length == 2) || ((length & (length - 1)) != 0))
if((length <= 2) || ((length & (length - 1)) != 0))
{
idxStr += SztToStr(bid); idxStr += "*me +"; idxStr += oddpadd; idxStr += SztToStr(lid);
}
Expand Down Expand Up @@ -1468,7 +1468,7 @@ namespace StockhamGenerator
if(fwd)
{
std::string idxStr, idxStrRev;
if((length == 2) || ((length & (length - 1)) != 0))
if((length <= 2) || ((length & (length - 1)) != 0))
{
idxStr += SztToStr(length/(2*workGroupSize)); idxStr += "*me +"; idxStr += oddpadd; idxStr += SztToStr(lid);
}
Expand Down Expand Up @@ -1541,7 +1541,7 @@ namespace StockhamGenerator
else
{
std::string idxStr, idxStrRev;
if((length == 2) || ((length & (length - 1)) != 0))
if((length <= 2) || ((length & (length - 1)) != 0))
{
idxStr += SztToStr(bid); idxStr += "*me +"; idxStr += oddpadd; idxStr += SztToStr(lid);
}
Expand Down

0 comments on commit 81be7cd

Please sign in to comment.