Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b031003a46 | ||
|
|
8541bc4928 |
No files matched your search
@@ -12,8 +12,8 @@ public static class PerfectNumberConstants
|
|||||||
public static readonly uint PrimesLimit = 1_000_000; //(ulong)Array.MaxLength;// 1_000_000;
|
public static readonly uint PrimesLimit = 1_000_000; //(ulong)Array.MaxLength;// 1_000_000;
|
||||||
public const int MaxOddPowersCount = 128;
|
public const int MaxOddPowersCount = 128;
|
||||||
public const int PooledArrayThreshold = 64;
|
public const int PooledArrayThreshold = 64;
|
||||||
public static readonly int RollingAccelerators = 298; //SharedGpuContext.Device.MaxNumThreadsPerGroup;
|
public static readonly int RollingAccelerators = 100; //SharedGpuContext.Device.MaxNumThreadsPerGroup;
|
||||||
public const int ThreadsByAccelerator = 1;
|
public const int ThreadsByAccelerator = 4096;
|
||||||
// TODO: Load these limits from the benchmark-driven configuration so CPU and GPU scans stay aligned with the optimal
|
// TODO: Load these limits from the benchmark-driven configuration so CPU and GPU scans stay aligned with the optimal
|
||||||
// divisor-cycle datasets we generate offline.
|
// divisor-cycle datasets we generate offline.
|
||||||
// TODO: Promote these magic numbers into a runtime profile derived from EvenPerfectBitScanner.Benchmarks so we can retune
|
// TODO: Promote these magic numbers into a runtime profile derived from EvenPerfectBitScanner.Benchmarks so we can retune
|
||||||
|
|||||||
@@ -1177,7 +1177,7 @@ internal static partial class PrimeOrderCalculator
|
|||||||
// bool isPrime = HeuristicCombinedPrimeTester.IsPrimeGpu(gpu, composite);
|
// bool isPrime = HeuristicCombinedPrimeTester.IsPrimeGpu(gpu, composite);
|
||||||
bool runOnGpu = RunOnGpu();
|
bool runOnGpu = RunOnGpu();
|
||||||
|
|
||||||
bool isPrime = runOnGpu ? PrimeTester.IsPrime(composite) : HeuristicCombinedPrimeTester.IsPrimeGpu(gpu, composite);
|
bool isPrime = !runOnGpu ? PrimeTester.IsPrime(composite) : HeuristicCombinedPrimeTester.IsPrimeGpu(gpu, composite);
|
||||||
// bool isPrime = PrimeTester.IsPrime(composite);
|
// bool isPrime = PrimeTester.IsPrime(composite);
|
||||||
// bool isPrime = Open.Numeric.Primes.Prime.Numbers.IsPrime(composite);
|
// bool isPrime = Open.Numeric.Primes.Prime.Numbers.IsPrime(composite);
|
||||||
|
|
||||||
@@ -1375,6 +1375,7 @@ internal static partial class PrimeOrderCalculator
|
|||||||
|
|
||||||
private static bool RunOnGpu()
|
private static bool RunOnGpu()
|
||||||
{
|
{
|
||||||
|
return true;
|
||||||
const int GpuFrequency = 1024 - 1;
|
const int GpuFrequency = 1024 - 1;
|
||||||
|
|
||||||
int cpuCount = Atomic.Add(target: ref _cpuCount, 1);
|
int cpuCount = Atomic.Add(target: ref _cpuCount, 1);
|
||||||
|
|||||||
Binary file not shown.
Reference in new issue
Block a user