Remove CPU fallback from GPU context pool

This commit is contained in:
Marek Lemańczyk committed 2025-10-11 18:31:46 +02:00
1 parent 3e2d2b05b1
commit d476748216
2 files changed
+10 -4

No files matched your search

+6 -3
View File
@@ -145,8 +145,7 @@ public static class GpuContextPool
public object ExecutionLock => _ctx.ExecutionLock;
public void Dispose()
internal void ReturnToPool()
{
if (disposed)
{
@@ -156,6 +155,10 @@ public static class GpuContextPool
Return(_ctx);
disposed = true;
}
public void Dispose()
{
ReturnToPool();
}
}
}
+4 -1
View File
@@ -396,7 +396,10 @@ public ref struct GpuKernelLease(IDisposable limiter, GpuContextLease gpu, Kerne
_stream?.Dispose();
_stream = null;
_gpu?.Dispose();
if (_gpu.HasValue)
{
_gpu.Value.ReturnToPool();
}
_gpu = null;
_executionLock = null;