TODOs added

This commit is contained in:
mlemanczyk committed 2025-10-18 23:59:18 +02:00
1 parent e78150b242
commit 7f468de485
1 file changed
+11 -2
+11 -2
View File
@@ -560,6 +560,7 @@ internal static class Program
}
}
// TODO: Move this to a new static class called CandidatesCalculator. It should be under Candidates namespace / folder
private static List<ulong> BuildTestPrimeCandidates(int targetCount)
{
if (targetCount <= 0)
@@ -713,7 +714,6 @@ internal static class Program
}
}
private static string BuildResultsFileName(bool bitInc, int threads, int block, GpuKernelType kernelType, bool useLucasFlag, bool useDivisorFlag, bool useByDivisorFlag, bool mersenneOnGpu, bool useOrder, bool useGcd, NttBackend nttBackend, int gpuPrimeThreads, int llSlice, int gpuScanBatch, ulong warmupLimit, ModReductionMode reduction, string mersenneDevice, string primesDevice, string orderDevice)
{
string inc = bitInc ? "bit" : "add";
@@ -771,6 +771,7 @@ internal static class Program
}
}
// TODO: Move this to a new static class called CandidatesCalculator. It should be under Candidates namespace / folder
[MethodImpl(MethodImplOptions.AggressiveInlining)]
private static ulong AdvancePrime(ulong value, ref ulong remainder) => TransformMode switch
{
@@ -779,6 +780,7 @@ internal static class Program
_ => TransformPAddPrimes(value, ref remainder),
};
// TODO: Move this to a new static class called CandidatesCalculator. It should be under Candidates namespace / folder
[MethodImpl(MethodImplOptions.AggressiveInlining)]
private static int ReserveBlock(ulong[] buffer, int blockSize)
{
@@ -852,6 +854,7 @@ internal static class Program
}
}
// TODO: Move this to a new static class called CalculationTestTime. It should be under Candidates namespace / folder
private static void ReportTestTime(TimeSpan elapsed)
{
double elapsedSeconds = elapsed.TotalSeconds;
@@ -881,6 +884,7 @@ internal static class Program
}
}
// TODO: Move this to a new static class called CalculationTestTime. It should be under Candidates namespace / folder
private static string GetTestTimeFilePath()
{
if (string.IsNullOrEmpty(_cliArguments.ResultsDirectory))
@@ -891,6 +895,7 @@ internal static class Program
return Path.Combine(_cliArguments.ResultsDirectory!, TestTimeFileName);
}
// TODO: Move this to a new static class called CalculationTestTime. It should be under Candidates namespace / folder
private static bool TryReadTestTime(string filePath, out double milliseconds)
{
if (!File.Exists(filePath))
@@ -909,6 +914,7 @@ internal static class Program
return double.TryParse(content, NumberStyles.Float, CultureInfo.InvariantCulture, out milliseconds);
}
// TODO: Move this to a new static class called CalculationTestTime. It should be under Candidates namespace / folder
private static void WriteTestTime(string filePath, double milliseconds)
{
string? directory = Path.GetDirectoryName(filePath);
@@ -929,6 +935,7 @@ internal static class Program
return (ulong)BitOperations.PopCount(value);
}
// TODO: Move this to a new static class called CandidatesCalculator, converting to an extension method. Rename it to GetNextAddDiff. It should be under Candidates namespace / folder
[MethodImpl(MethodImplOptions.AggressiveInlining)]
private static ulong GetNextAddDiff(ulong remainder)
{
@@ -943,6 +950,7 @@ internal static class Program
};
}
// TODO: Convert this to a static class, called CandidateBitTransform under Candidates.Transforms namespace / folders. The method should be called "Transform".
[MethodImpl(MethodImplOptions.AggressiveInlining)]
internal static ulong TransformPBit(ulong value, ref ulong remainder)
{
@@ -987,6 +995,7 @@ internal static class Program
return next + value;
}
// TODO: Convert this to a static class, called CandidateAddTransform under Candidates.Transforms namespace / folders. The method should be called "Transform".
[MethodImpl(MethodImplOptions.AggressiveInlining)]
internal static ulong TransformPAdd(ulong value, ref ulong remainder)
{
@@ -1009,6 +1018,7 @@ internal static class Program
return next + diff;
}
// TODO: Convert this to a static class, called CandidateAddPrimesTransform under Candidates.Transforms namespace / folders. The method should be called "Transform".
[MethodImpl(MethodImplOptions.AggressiveInlining)]
internal static ulong TransformPAddPrimes(ulong value, ref ulong remainder)
{
@@ -1188,5 +1198,4 @@ internal static class Program
return false;
}
}