Tiny cleanup

This commit is contained in:
mlemanczyk committed 2026-01-22 15:11:16 +01:00
1 parent 302bfba40c
commit c63ff5df32
1 file changed
+16 -16
+16 -16
View File
@@ -12,22 +12,22 @@ public static class GpuPrimeWorkLimiter
public static int CurrentLimit => _currentLimit; public static int CurrentLimit => _currentLimit;
public static void SetLimit(int value) public static void SetLimit(int value)
{ {
if (value <= 0) if (value <= 0)
{ {
value = 1; value = 1;
} }
if (value == _currentLimit) if (value == _currentLimit)
{ {
return; return;
}
// TODO: Switch to a shared limiter implementation with GpuWorkLimiter so we can coordinate CPU/GPU prime work using
// the same semaphore pool without reallocating per adjustment.
// var previous = _semaphore;
_semaphore = new PollingSemaphore(value, _pauseBetweenChecks);
_currentLimit = value;
// previous.Dispose();
} }
// TODO: Switch to a shared limiter implementation with GpuWorkLimiter so we can coordinate CPU/GPU prime work using
// the same semaphore pool without reallocating per adjustment.
// var previous = _semaphore;
_semaphore = new PollingSemaphore(value, _pauseBetweenChecks);
_currentLimit = value;
// previous.Dispose();
}
} }