GpuPrimeWorkLimiter.Acquire() / .Release() removed to save time on the hot-path with billions of calls. We'll rely on AcceleratorStreamPool limits and synchronization.

This commit is contained in:
mlemanczyk committed 2025-11-13 17:52:13 +01:00
1 parent 1552e10ff0
commit 0d2a88c45f
17 files changed
+108 -124

No files matched your search

@@ -16,7 +16,7 @@ public class MersenneNumberIncrementalGpuTester(GpuKernelType kernelType, bool u
{
throw new NotImplementedException($"GPU incremental scanning requires the device cycle heuristics implementation (kernel: {_kernelType}, GPU order: {_useGpuOrder}).");
GpuPrimeWorkLimiter.Acquire();
// GpuPrimeWorkLimiter.Acquire();
var accelerator = AcceleratorPool.Shared.Rent();
var stream = accelerator.CreateStream();
int batchSize = GpuConstants.ScanBatchSize; // large batch improves GPU occupancy
@@ -125,6 +125,6 @@ public class MersenneNumberIncrementalGpuTester(GpuKernelType kernelType, bool u
stream.Dispose();
ulongPool.Return(orderArray);
orderBuffer.Dispose();
GpuPrimeWorkLimiter.Release();
// GpuPrimeWorkLimiter.Release();
}
}