Remove CPU fallback from GPU context pool
This commit is contained in:
1 parent
3e2d2b05b1
commit
d476748216
2 files changed
+10
-4
No files matched your search
@@ -145,8 +145,7 @@ public static class GpuContextPool
|
|||||||
|
|
||||||
public object ExecutionLock => _ctx.ExecutionLock;
|
public object ExecutionLock => _ctx.ExecutionLock;
|
||||||
|
|
||||||
|
internal void ReturnToPool()
|
||||||
public void Dispose()
|
|
||||||
{
|
{
|
||||||
if (disposed)
|
if (disposed)
|
||||||
{
|
{
|
||||||
@@ -156,6 +155,10 @@ public static class GpuContextPool
|
|||||||
Return(_ctx);
|
Return(_ctx);
|
||||||
disposed = true;
|
disposed = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void Dispose()
|
||||||
|
{
|
||||||
|
ReturnToPool();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -396,7 +396,10 @@ public ref struct GpuKernelLease(IDisposable limiter, GpuContextLease gpu, Kerne
|
|||||||
_stream?.Dispose();
|
_stream?.Dispose();
|
||||||
_stream = null;
|
_stream = null;
|
||||||
|
|
||||||
_gpu?.Dispose();
|
if (_gpu.HasValue)
|
||||||
|
{
|
||||||
|
_gpu.Value.ReturnToPool();
|
||||||
|
}
|
||||||
_gpu = null;
|
_gpu = null;
|
||||||
|
|
||||||
_executionLock = null;
|
_executionLock = null;
|
||||||
|
|||||||
Reference in new issue
Block a user