Fix GPU residue tester iteration and add regression tests
This commit is contained in:
1 parent
4650faed58
commit
f9b4f912e2
2 files changed
+84
-3
No files matched your search
@@ -59,9 +59,9 @@ public class MersenneNumberResidueGpuTester(bool useGpuOrder)
|
||||
Span<ulong> orders = orderArray.AsSpan(0, batchSize);
|
||||
try
|
||||
{
|
||||
for (ulong setIndex = 0; setIndex < setCount && Volatile.Read(ref isPrime); setIndex++)
|
||||
for (UInt128 setIndex = UInt128.Zero; setIndex < setCount && Volatile.Read(ref isPrime); setIndex++)
|
||||
{
|
||||
UInt128 setOffset = checked(perSetLimit * (UInt128)setIndex);
|
||||
UInt128 setOffset = checked(perSetLimit * setIndex);
|
||||
UInt128 setStart = checked(setOffset + UInt128.One);
|
||||
if (setStart >= limitInclusive)
|
||||
{
|
||||
@@ -113,7 +113,7 @@ public class MersenneNumberResidueGpuTester(bool useGpuOrder)
|
||||
}
|
||||
}
|
||||
|
||||
kStart = checked(kStart + batchSize128);
|
||||
kStart = checked(kStart + (UInt128)currentSize);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user