Kernels replaced with pre-compiled actions for better performance

This commit is contained in:
mlemanczyk committed 2025-11-20 03:00:11 +01:00
1 parent df04ba601c
commit 497b1fcf89
7 files changed
+39 -66

No files matched your search

@@ -235,13 +235,12 @@ public sealed class HeuristicCombinedPrimeTester
private static bool HeuristicTrialDivisionGpuDetectsDivisor(PrimeOrderCalculatorAccelerator gpu, ulong n, ulong maxDivisorSquare, byte nMod10)
{
var acceleratorIndex = gpu.AcceleratorIndex;
var stream = AcceleratorStreamPool.Rent(acceleratorIndex);
var kernel = gpu.HeuristicCombinedTrialDivisionKernel;
var flagView1D = gpu.OutputInt!.View;
bool compositeDetected;
// int compositeFlag = 0;
Span<int> compositeFlag = stackalloc int[1];
// int compositeFlag = 0;
var stream = AcceleratorStreamPool.Rent(acceleratorIndex);
flagView1D.MemSetToZero(stream);
var kernelLauncher = gpu.HeuristicCombinedTrialDivisionKernelLauncher;