Revert "Merge pull request #251 from mlemanczyk/codex/refactor-prime-checking-on-gpu-n5t2pm"
This reverts commit936ce239db, reversing changes made toe14b77e504.
This commit is contained in:
1 parent
936ce239db
commit
2281d9535e
23 files changed
+880
-1187
No files matched your search
@@ -37,6 +37,7 @@ public class PrimeTesterIsPrimeTests
|
||||
[InlineData(279UL, false)]
|
||||
public void IsPrimeGpu_uses_residue_specific_tables(ulong n, bool expected)
|
||||
{
|
||||
GpuContextPool.ForceCpu = false;
|
||||
var tester = new PrimeTester();
|
||||
|
||||
tester.IsPrimeGpu(n).Should().Be(expected);
|
||||
@@ -47,14 +48,20 @@ public class PrimeTesterIsPrimeTests
|
||||
public void IsPrimeGpu_falls_back_to_cpu_when_forced()
|
||||
{
|
||||
var tester = new PrimeTester();
|
||||
PrimeTester.IsPrime(137UL).Should().BeTrue();
|
||||
PrimeTester.IsPrime(341UL).Should().BeFalse();
|
||||
GpuContextPool.ForceCpu = true;
|
||||
|
||||
tester.IsPrimeGpu(137UL).Should().BeTrue();
|
||||
|
||||
tester.IsPrimeGpu(341UL).Should().BeFalse();
|
||||
|
||||
GpuContextPool.ForceCpu = false;
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[Trait("Category", "Fast")]
|
||||
public void IsPrimeGpu_handles_parallel_calls_for_known_primes()
|
||||
{
|
||||
GpuContextPool.ForceCpu = false;
|
||||
GpuPrimeWorkLimiter.SetLimit(64);
|
||||
PrimeTester.GpuBatchSize = 256_000;
|
||||
|
||||
|
||||
Reference in new issue
Block a user