Align residue GPU divisor limit with divisor mode
This commit is contained in:
1 parent
cf4f93fbfe
commit
2d9a261867
3 files changed
+81
-18
No files matched your search
@@ -268,6 +268,20 @@ public sealed class MersenneNumberTester(
|
||||
}
|
||||
|
||||
UInt128 requestedSets = _residueDivisorSetCount;
|
||||
if (_useGpuScan)
|
||||
{
|
||||
UInt128 maxUsefulSets = DivideRoundUp(totalLimit, (UInt128)GpuConstants.ScanBatchSize);
|
||||
if (maxUsefulSets == UInt128.Zero)
|
||||
{
|
||||
maxUsefulSets = UInt128.One;
|
||||
}
|
||||
|
||||
if (requestedSets == UInt128.Zero || requestedSets > maxUsefulSets)
|
||||
{
|
||||
requestedSets = maxUsefulSets;
|
||||
}
|
||||
}
|
||||
|
||||
if (requestedSets == UInt128.Zero)
|
||||
{
|
||||
requestedSets = UInt128.One;
|
||||
|
||||
Reference in new issue
Block a user