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

This reverts commit a84445ef2a.
This commit is contained in:
mlemanczyk committed 2025-11-16 17:14:48 +01:00
1 parent a84445ef2a
commit c413ee1162
15 files changed
+73 -67

No files matched your search

+2 -2
View File
@@ -898,7 +898,7 @@ public class MersenneDivisorCycles
start = end + 1UL;
}
AcceleratorStreamPool.Return(acceleratorIndex);
AcceleratorStreamPool.Return(acceleratorIndex, stream);
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 ??= new Kernel[PerfectNumberConstants.RollingAccelerators];
var pool = _divisorCycleKernel ??= [];
if (pool[acceleratorIndex] is {} cached)
{
return cached;