Stream handling simplified to avoid dictionary lookups in favor of array lookups with known indexes.
This commit is contained in:
1 parent
cd7636ddbe
commit
a84445ef2a
15 files changed
+67
-73
No files matched your search
@@ -123,7 +123,7 @@ public sealed class PrimeTester
|
||||
outputView.CopyToCPU(stream, ref flag, 1);
|
||||
stream.Synchronize();
|
||||
|
||||
AcceleratorStreamPool.Return(acceleratorIndex, stream);
|
||||
AcceleratorStreamPool.Return(acceleratorIndex);
|
||||
PrimeOrderCalculatorAccelerator.Return(gpu);
|
||||
// GpuPrimeWorkLimiter.Release();
|
||||
|
||||
@@ -162,7 +162,7 @@ public sealed class PrimeTester
|
||||
|
||||
outputView.CopyToCPU(stream, ref flag, 1);
|
||||
stream.Synchronize();
|
||||
AcceleratorStreamPool.Return(acceleratorIndex, stream);
|
||||
AcceleratorStreamPool.Return(acceleratorIndex);
|
||||
|
||||
return flag != 0;
|
||||
}
|
||||
@@ -239,7 +239,7 @@ public sealed class PrimeTester
|
||||
}
|
||||
|
||||
stream.Synchronize();
|
||||
AcceleratorStreamPool.Return(acceleratorIndex, stream);
|
||||
AcceleratorStreamPool.Return(acceleratorIndex);
|
||||
PrimeOrderCalculatorAccelerator.Return(gpu);
|
||||
// GpuPrimeWorkLimiter.Release();
|
||||
}
|
||||
@@ -295,7 +295,7 @@ public sealed class PrimeTester
|
||||
resultBuffer.View.CopyToCPU(stream, in results);
|
||||
stream.Synchronize();
|
||||
|
||||
AcceleratorStreamPool.Return(acceleratorIndex, stream);
|
||||
AcceleratorStreamPool.Return(acceleratorIndex);
|
||||
PrimeOrderCalculatorAccelerator.Return(gpu);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user