Cleanup
This commit is contained in:
1 parent
e8b4c1fc83
commit
47521e327a
3 files changed
+3
-12
No files matched your search
@@ -33,7 +33,7 @@ public class PrimeTesterBenchmarks
|
|||||||
_ = HeuristicPrimeTester.IsPrimeCpu(_candidates[0]);
|
_ = HeuristicPrimeTester.IsPrimeCpu(_candidates[0]);
|
||||||
_ = HeuristicPrimeTester.IsPrimeGpu(gpu, _candidates[0]);
|
_ = HeuristicPrimeTester.IsPrimeGpu(gpu, _candidates[0]);
|
||||||
_ = Prime.Numbers.IsPrime(_candidates[0]);
|
_ = Prime.Numbers.IsPrime(_candidates[0]);
|
||||||
PrimeOrderCalculatorAccelerator.Return(gpu);
|
PrimeOrderCalculatorAccelerator.Return(gpu);
|
||||||
}
|
}
|
||||||
|
|
||||||
// [Benchmark]
|
// [Benchmark]
|
||||||
@@ -67,8 +67,8 @@ public class PrimeTesterBenchmarks
|
|||||||
primeCount++;
|
primeCount++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
PrimeOrderCalculatorAccelerator.Return(gpu);
|
|
||||||
|
|
||||||
|
PrimeOrderCalculatorAccelerator.Return(gpu);
|
||||||
return primeCount;
|
return primeCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -168,16 +168,6 @@ public sealed class HeuristicCombinedPrimeTester
|
|||||||
return HeuristicTrialDivisionCpu(n, maxDivisorSquare, nMod10);
|
return HeuristicTrialDivisionCpu(n, maxDivisorSquare, nMod10);
|
||||||
}
|
}
|
||||||
|
|
||||||
// public static bool IsPrimeGpu(ulong n)
|
|
||||||
// {
|
|
||||||
// byte nMod10 = (byte)n.Mod10();
|
|
||||||
// ulong maxDivisorSquare = ComputeHeuristicDivisorSquareLimit(n);
|
|
||||||
// var gpu = PrimeOrderCalculatorAccelerator.Rent(1);
|
|
||||||
// bool isPrime = IsPrimeGpu(gpu, n, maxDivisorSquare, nMod10);
|
|
||||||
// PrimeOrderCalculatorAccelerator.Return(gpu);
|
|
||||||
// return isPrime;
|
|
||||||
// }
|
|
||||||
|
|
||||||
public static bool IsPrimeGpu(PrimeOrderCalculatorAccelerator gpu, ulong n)
|
public static bool IsPrimeGpu(PrimeOrderCalculatorAccelerator gpu, ulong n)
|
||||||
{
|
{
|
||||||
byte nMod10 = (byte)n.Mod10();
|
byte nMod10 = (byte)n.Mod10();
|
||||||
|
|||||||
@@ -180,6 +180,7 @@ public sealed class MersenneNumberTester(
|
|||||||
{
|
{
|
||||||
tmp[i] = (GpuUInt128)qs[offset + i];
|
tmp[i] = (GpuUInt128)qs[offset + i];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Copy only the populated elements to the device buffer to avoid overrun on pooled arrays.
|
// Copy only the populated elements to the device buffer to avoid overrun on pooled arrays.
|
||||||
qBuffer.View.CopyFromCPU(stream, ref tmp[0], count);
|
qBuffer.View.CopyFromCPU(stream, ref tmp[0], count);
|
||||||
gpuUInt128Pool.Return(tmp);
|
gpuUInt128Pool.Return(tmp);
|
||||||
|
|||||||
Reference in new issue
Block a user