--mersenne=bydivisor testers and sessions integrated and converted to structs.

This commit is contained in:
mlemanczyk committed 2025-12-18 05:07:31 +01:00
1 parent 3c80221105
commit 2abc6aae49
32 files changed
+3814 -1505

No files matched your search

@@ -0,0 +1,31 @@
using System.Numerics;
using System.Runtime.CompilerServices;
using PerfectNumbers.Core.Gpu;
namespace PerfectNumbers.Core;
#pragma warning disable CA2211 // The fields are settable on purpose for the best performance
public static class EnvironmentConfiguration
{
public static ulong DivisorLimit = ulong.MaxValue;
public static int GpuBatchSize = GpuConstants.ScanBatchSize;
public static int GpuRatio = PerfectNumberConstants.GpuRatio;
public static BigInteger MinK = BigInteger.One;
public static ComputationDevice OrderDevice = ComputationDevice.Cpu;
public static int RollingAccelerators = PerfectNumberConstants.RollingAccelerators;
public static string? StateFilePath;
public static bool UseGpuOrder;
public static bool UseHybridOrder;
public static bool UseCpuOrder;
[MethodImpl(MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization)]
public static void Initialize()
{
UseGpuOrder = OrderDevice == ComputationDevice.Gpu;
UseHybridOrder = OrderDevice == ComputationDevice.Hybrid;
UseCpuOrder = OrderDevice == ComputationDevice.Cpu;
}
}
#pragma warning restore CA2211 // Non-constant fields should not be visible