Pow2Mod kernel specific methods moved to Pow2MontgomeryKernels.

This commit is contained in:
mlemanczyk committed 2025-11-24 18:04:07 +01:00
1 parent 070e2a14fd
commit 57a50e2a37
14 files changed
+419 -402

No files matched your search

@@ -86,28 +86,17 @@ internal static class PrimeTesterKernels
ulong maxDivisorSquare,
HeuristicCombinedGpuViews tables)
{
// byte nMod10 = (byte)(n % 10UL);
ArrayView1D<ulong, Stride1D.Dense> divisors = tables.SelectDivisors(nMod10);
ArrayView1D<ulong, Stride1D.Dense> divisorSquares = tables.SelectDivisorSquares(nMod10);
var (divisors, divisorSquares) = tables.SelectDivisorsAndSquares(nMod10);
int divisorLength = (int)divisorSquares.Length;
int threadIndex = index;
if (threadIndex >= divisorLength)
if (divisorSquares[threadIndex] > maxDivisorSquare)
{
return;
}
ulong divisorSquare = divisorSquares[threadIndex];
if (divisorSquare > maxDivisorSquare)
if (n % divisors[threadIndex] == 0UL)
{
return;
}
ulong divisor = divisors[threadIndex];
divisor = n % divisor;
if (divisor == 0UL)
{
resultFlag[0] = 1;
Atomic.Exchange(ref resultFlag[0], 1);
}
}