Prime testing using divisor tables depending on the last digit separated to its own class. PrimeTester switched back to standard endings.
This commit is contained in:
1 parent
a296e62d4d
commit
c311b27dcc
12 files changed
+526
-215
No files matched your search
@@ -80,21 +80,17 @@ internal static class PrimeTesterKernels
|
||||
|
||||
public static void HeuristicTrialCombinedDivisionKernel(
|
||||
Index1D index,
|
||||
byte nMod10,
|
||||
// byte nMod10,
|
||||
ArrayView<int> resultFlag,
|
||||
ulong n,
|
||||
ulong maxDivisorSquare,
|
||||
HeuristicCombinedGpuViews tables)
|
||||
ArrayView<ulong> divisors,
|
||||
ArrayView<ulong> divisorSquares)
|
||||
{
|
||||
var (divisors, divisorSquares) = tables.SelectDivisorsAndSquares(nMod10);
|
||||
// var (divisors, divisorSquares) = tables.SelectDivisorsAndSquares(nMod10);
|
||||
|
||||
int threadIndex = index;
|
||||
if (divisorSquares[threadIndex] > maxDivisorSquare)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (n % divisors[threadIndex] == 0UL)
|
||||
if (divisorSquares[threadIndex] <= maxDivisorSquare && (n % divisors[threadIndex] == 0UL))
|
||||
{
|
||||
Atomic.Exchange(ref resultFlag[0], 1);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user