Compilation errors fixed

This commit is contained in:
mlemanczyk committed 2025-10-17 02:40:15 +02:00
1 parent a0154dd587
commit 495b3918c1
3 files changed
+14 -11

No files matched your search

+12 -10
View File
@@ -1,9 +1,10 @@
using System; using System;
using System.Numerics; using System.Numerics;
using System.Runtime.CompilerServices;
namespace PerfectNumbers.Core; namespace PerfectNumbers.Core;
internal struct CycleRemainderStepper public struct CycleRemainderStepper
{ {
private readonly ulong _cycleLength; private readonly ulong _cycleLength;
private ulong _previousPrime; private ulong _previousPrime;
@@ -23,15 +24,16 @@ internal struct CycleRemainderStepper
_hasState = false; _hasState = false;
} }
public void Reset() [MethodImpl(MethodImplOptions.AggressiveInlining)]
{ public void Reset()
// TODO: Inline this reset at the call sites so the hot loops reuse struct reinitialization {
// measured fastest in MersenneDivisorCycleLengthGpuBenchmarks, avoiding the extra // TODO: Inline this reset at the call sites so the hot loops reuse struct reinitialization
// method call when scanners need to restart stepping. // measured fastest in MersenneDivisorCycleLengthGpuBenchmarks, avoiding the extra
_previousPrime = 0UL; // method call when scanners need to restart stepping.
_currentRemainder = 0UL; _previousPrime = 0UL;
_hasState = false; _currentRemainder = 0UL;
} _hasState = false;
}
public ulong Initialize(ulong prime) public ulong Initialize(ulong prime)
{ {
@@ -1522,4 +1522,4 @@ internal static partial class PrimeOrderCalculator
public readonly long Tertiary = tertiary; public readonly long Tertiary = tertiary;
} }
} }
}
@@ -5,6 +5,7 @@ using System.Diagnostics;
using System.Numerics; using System.Numerics;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using System.Threading; using System.Threading;
using PerfectNumbers.Core.Gpu;
namespace PerfectNumbers.Core; namespace PerfectNumbers.Core;