Stream handling simplified to avoid dictionary lookups in favor of array lookups with known indexes.

This commit is contained in:
mlemanczyk committed 2025-11-16 15:01:51 +01:00
1 parent cd7636ddbe
commit a84445ef2a
15 files changed
+67 -73

No files matched your search

+2 -2
View File
@@ -898,7 +898,7 @@ public class MersenneDivisorCycles
start = end + 1UL;
}
AcceleratorStreamPool.Return(acceleratorIndex, stream);
AcceleratorStreamPool.Return(acceleratorIndex);
pool.Return(divisors, clearArray: false);
pool.Return(outCycles, clearArray: false);
@@ -907,7 +907,7 @@ public class MersenneDivisorCycles
private static Kernel GetDivisorCycleKernel(int acceleratorIndex)
{
var pool = _divisorCycleKernel ??= [];
var pool = _divisorCycleKernel ??= new Kernel[PerfectNumberConstants.RollingAccelerators];
if (pool[acceleratorIndex] is {} cached)
{
return cached;