Naming improvements and small cleanup
This commit is contained in:
1 parent
bf7c4bab39
commit
66ca969929
10 files changed
+35
-30
No files matched your search
+5
-5
@@ -3,17 +3,17 @@ using ILGPU.Runtime;
|
|||||||
|
|
||||||
namespace PerfectNumbers.Core.Gpu.Accelerators;
|
namespace PerfectNumbers.Core.Gpu.Accelerators;
|
||||||
|
|
||||||
internal sealed class HeuristicGpuCombinedTables
|
internal readonly struct HeuristicCombinedGpuTables
|
||||||
{
|
{
|
||||||
private static readonly Accelerator[] _accelerators = AcceleratorPool.Shared.Accelerators;
|
private static readonly Accelerator[] _accelerators = AcceleratorPool.Shared.Accelerators;
|
||||||
|
|
||||||
private static readonly HeuristicGpuCombinedTables[] _sharedTables = new HeuristicGpuCombinedTables[PerfectNumberConstants.RollingAccelerators];
|
private static readonly HeuristicCombinedGpuTables[] _sharedTables = new HeuristicCombinedGpuTables[PerfectNumberConstants.RollingAccelerators];
|
||||||
|
|
||||||
internal static void WarmUp(int acceleratorIndex, AcceleratorStream stream) => _sharedTables[acceleratorIndex] = new(_accelerators[acceleratorIndex], stream);
|
internal static void WarmUp(int acceleratorIndex, AcceleratorStream stream) => _sharedTables[acceleratorIndex] = new(_accelerators[acceleratorIndex], stream);
|
||||||
|
|
||||||
internal static HeuristicGpuCombinedTables GetStaticTables(int acceleratorIndex) => _sharedTables[acceleratorIndex];
|
internal static HeuristicCombinedGpuTables GetStaticTables(int acceleratorIndex) => _sharedTables[acceleratorIndex];
|
||||||
|
|
||||||
internal HeuristicGpuCombinedTables(Accelerator accelerator, AcceleratorStream stream)
|
internal HeuristicCombinedGpuTables(Accelerator accelerator, AcceleratorStream stream)
|
||||||
{
|
{
|
||||||
var combinedEnding1 = HeuristicCombinedPrimeTester.CombinedDivisorsEnding1;
|
var combinedEnding1 = HeuristicCombinedPrimeTester.CombinedDivisorsEnding1;
|
||||||
HeuristicCombinedDivisorsEnding1 = accelerator.CopySpanToDevice(stream, combinedEnding1);
|
HeuristicCombinedDivisorsEnding1 = accelerator.CopySpanToDevice(stream, combinedEnding1);
|
||||||
@@ -45,7 +45,7 @@ internal sealed class HeuristicGpuCombinedTables
|
|||||||
internal readonly MemoryBuffer1D<ulong, Stride1D.Dense> HeuristicCombinedDivisorsEnding9;
|
internal readonly MemoryBuffer1D<ulong, Stride1D.Dense> HeuristicCombinedDivisorsEnding9;
|
||||||
internal readonly MemoryBuffer1D<ulong, Stride1D.Dense> HeuristicCombinedDivisorSquaresEnding9;
|
internal readonly MemoryBuffer1D<ulong, Stride1D.Dense> HeuristicCombinedDivisorSquaresEnding9;
|
||||||
|
|
||||||
internal HeuristicGpuCombinedDivisorTables CreateHeuristicDivisorTables() => new(
|
internal HeuristicCombinedGpuViews CreateViews() => new(
|
||||||
HeuristicCombinedDivisorsEnding1.View,
|
HeuristicCombinedDivisorsEnding1.View,
|
||||||
HeuristicCombinedDivisorsEnding3.View,
|
HeuristicCombinedDivisorsEnding3.View,
|
||||||
HeuristicCombinedDivisorsEnding7.View,
|
HeuristicCombinedDivisorsEnding7.View,
|
||||||
+5
-5
@@ -3,15 +3,15 @@ using ILGPU.Runtime;
|
|||||||
|
|
||||||
namespace PerfectNumbers.Core.Gpu.Accelerators;
|
namespace PerfectNumbers.Core.Gpu.Accelerators;
|
||||||
|
|
||||||
internal sealed class HeuristicGpuGroupABTables
|
internal sealed class HeuristicGroupABGpuTables
|
||||||
{
|
{
|
||||||
private static readonly Accelerator[] _accelerators = AcceleratorPool.Shared.Accelerators;
|
private static readonly Accelerator[] _accelerators = AcceleratorPool.Shared.Accelerators;
|
||||||
|
|
||||||
private static readonly HeuristicGpuGroupABTables[] _sharedTables = new HeuristicGpuGroupABTables[PerfectNumberConstants.RollingAccelerators];
|
private static readonly HeuristicGroupABGpuTables[] _sharedTables = new HeuristicGroupABGpuTables[PerfectNumberConstants.RollingAccelerators];
|
||||||
|
|
||||||
private static readonly SemaphoreSlim[] _locks = [..Enumerable.Range(1, PerfectNumberConstants.RollingAccelerators).Select(_ => new SemaphoreSlim(1))];
|
private static readonly SemaphoreSlim[] _locks = [..Enumerable.Range(1, PerfectNumberConstants.RollingAccelerators).Select(_ => new SemaphoreSlim(1))];
|
||||||
|
|
||||||
internal static HeuristicGpuGroupABTables EnsureStaticTables(int acceleratorIndex, AcceleratorStream stream)
|
internal static HeuristicGroupABGpuTables EnsureStaticTables(int acceleratorIndex, AcceleratorStream stream)
|
||||||
{
|
{
|
||||||
var @lock = _locks[acceleratorIndex];
|
var @lock = _locks[acceleratorIndex];
|
||||||
@lock.Wait();
|
@lock.Wait();
|
||||||
@@ -28,7 +28,7 @@ internal sealed class HeuristicGpuGroupABTables
|
|||||||
return existing;
|
return existing;
|
||||||
}
|
}
|
||||||
|
|
||||||
internal HeuristicGpuGroupABTables(Accelerator accelerator, AcceleratorStream stream)
|
internal HeuristicGroupABGpuTables(Accelerator accelerator, AcceleratorStream stream)
|
||||||
{
|
{
|
||||||
var heuristicGroupA = HeuristicPrimeSieves.GroupADivisorsStorage;
|
var heuristicGroupA = HeuristicPrimeSieves.GroupADivisorsStorage;
|
||||||
HeuristicGroupADivisors = accelerator.CopySpanToDevice(stream, heuristicGroupA);
|
HeuristicGroupADivisors = accelerator.CopySpanToDevice(stream, heuristicGroupA);
|
||||||
@@ -55,7 +55,7 @@ internal sealed class HeuristicGpuGroupABTables
|
|||||||
internal readonly MemoryBuffer1D<ulong, Stride1D.Dense> HeuristicGroupBDivisorsEnding9;
|
internal readonly MemoryBuffer1D<ulong, Stride1D.Dense> HeuristicGroupBDivisorsEnding9;
|
||||||
internal readonly MemoryBuffer1D<ulong, Stride1D.Dense> HeuristicGroupBDivisorSquaresEnding9;
|
internal readonly MemoryBuffer1D<ulong, Stride1D.Dense> HeuristicGroupBDivisorSquaresEnding9;
|
||||||
|
|
||||||
internal HeuristicGpuGroupABDivisorTables CreateHeuristicDivisorTables() => new(
|
internal HeuristicGroupABGpuViews CreateViews() => new(
|
||||||
HeuristicGroupADivisors.View,
|
HeuristicGroupADivisors.View,
|
||||||
HeuristicGroupADivisorSquares.View,
|
HeuristicGroupADivisorSquares.View,
|
||||||
HeuristicGroupBDivisorsEnding1.View,
|
HeuristicGroupBDivisorsEnding1.View,
|
||||||
@@ -19,7 +19,7 @@ internal sealed class HeuristicGroupABPrimeTesterAccelerator
|
|||||||
Console.WriteLine($"Preparing heuristic accelerator {i}...");
|
Console.WriteLine($"Preparing heuristic accelerator {i}...");
|
||||||
var accelerator = accelerators[i];
|
var accelerator = accelerators[i];
|
||||||
AcceleratorStream stream = accelerator.CreateStream();
|
AcceleratorStream stream = accelerator.CreateStream();
|
||||||
_ = HeuristicGpuGroupABTables.EnsureStaticTables(i, stream);
|
_ = HeuristicGroupABGpuTables.EnsureStaticTables(i, stream);
|
||||||
// _ = GpuKernelPool.GetOrAddKernels(accelerator, stream, KernelType.None);
|
// _ = GpuKernelPool.GetOrAddKernels(accelerator, stream, KernelType.None);
|
||||||
// KernelContainer kernels = GpuKernelPool.GetOrAddKernels(accelerator, stream);
|
// KernelContainer kernels = GpuKernelPool.GetOrAddKernels(accelerator, stream);
|
||||||
// GpuStaticTableInitializer.EnsureStaticTables(accelerator, kernels, stream);
|
// GpuStaticTableInitializer.EnsureStaticTables(accelerator, kernels, stream);
|
||||||
@@ -75,7 +75,7 @@ internal sealed class HeuristicGroupABPrimeTesterAccelerator
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
public readonly HeuristicGpuGroupABDivisorTables DivisorTables;
|
public readonly HeuristicGroupABGpuViews DivisorTables;
|
||||||
internal readonly Context Context;
|
internal readonly Context Context;
|
||||||
public readonly Accelerator Accelerator;
|
public readonly Accelerator Accelerator;
|
||||||
|
|
||||||
@@ -102,7 +102,7 @@ internal sealed class HeuristicGroupABPrimeTesterAccelerator
|
|||||||
public MemoryBuffer1D<int, Stride1D.Dense>? HeuristicFlag = null!;
|
public MemoryBuffer1D<int, Stride1D.Dense>? HeuristicFlag = null!;
|
||||||
public int BufferCapacity;
|
public int BufferCapacity;
|
||||||
|
|
||||||
private HeuristicGpuGroupABTables _sharedTables;
|
private HeuristicGroupABGpuTables _sharedTables;
|
||||||
public MemoryBuffer1D<ulong, Stride1D.Dense> HeuristicGroupADivisors => _sharedTables.HeuristicGroupADivisors;
|
public MemoryBuffer1D<ulong, Stride1D.Dense> HeuristicGroupADivisors => _sharedTables.HeuristicGroupADivisors;
|
||||||
public MemoryBuffer1D<ulong, Stride1D.Dense> HeuristicGroupADivisorSquares => _sharedTables.HeuristicGroupADivisorSquares;
|
public MemoryBuffer1D<ulong, Stride1D.Dense> HeuristicGroupADivisorSquares => _sharedTables.HeuristicGroupADivisorSquares;
|
||||||
public MemoryBuffer1D<ulong, Stride1D.Dense> HeuristicGroupBDivisorsEnding1 => _sharedTables.HeuristicGroupBDivisorsEnding1;
|
public MemoryBuffer1D<ulong, Stride1D.Dense> HeuristicGroupBDivisorsEnding1 => _sharedTables.HeuristicGroupBDivisorsEnding1;
|
||||||
@@ -125,14 +125,14 @@ internal sealed class HeuristicGroupABPrimeTesterAccelerator
|
|||||||
Accelerator = accelerator;
|
Accelerator = accelerator;
|
||||||
EnsureCapacity(minBufferCapacity);
|
EnsureCapacity(minBufferCapacity);
|
||||||
|
|
||||||
HeuristicTrialDivisionKernel = KernelUtil.GetKernel(accelerator.LoadAutoGroupedStreamKernel<Index1D, ArrayView<int>, ulong, ulong, HeuristicGpuDivisorTableKind, HeuristicGpuGroupABDivisorTables>(PrimeTesterKernels.HeuristicTrialGroupABDivisionKernel));
|
HeuristicTrialDivisionKernel = KernelUtil.GetKernel(accelerator.LoadAutoGroupedStreamKernel<Index1D, ArrayView<int>, ulong, ulong, HeuristicGpuDivisorTableKind, HeuristicGroupABGpuViews>(PrimeTesterKernels.HeuristicTrialGroupABDivisionKernel));
|
||||||
|
|
||||||
AcceleratorStream stream = AcceleratorStreamPool.Rent(acceleratorIndex);
|
AcceleratorStream stream = AcceleratorStreamPool.Rent(acceleratorIndex);
|
||||||
|
|
||||||
// GpuStaticTableInitializer.EnsureStaticTables(accelerator, kernels, stream);
|
// GpuStaticTableInitializer.EnsureStaticTables(accelerator, kernels, stream);
|
||||||
|
|
||||||
_sharedTables = HeuristicGpuGroupABTables.EnsureStaticTables(acceleratorIndex, stream);
|
_sharedTables = HeuristicGroupABGpuTables.EnsureStaticTables(acceleratorIndex, stream);
|
||||||
DivisorTables = _sharedTables.CreateHeuristicDivisorTables();
|
DivisorTables = _sharedTables.CreateViews();
|
||||||
|
|
||||||
stream.Synchronize();
|
stream.Synchronize();
|
||||||
AcceleratorStreamPool.Return(acceleratorIndex, stream);
|
AcceleratorStreamPool.Return(acceleratorIndex, stream);
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ public sealed class PrimeOrderCalculatorAccelerator
|
|||||||
AcceleratorStream stream = accelerator.CreateStream();
|
AcceleratorStream stream = accelerator.CreateStream();
|
||||||
// TODO: Review which tables are needed when final execution path is defined.
|
// TODO: Review which tables are needed when final execution path is defined.
|
||||||
LastDigitGpuTables.WarmUp(i, stream);
|
LastDigitGpuTables.WarmUp(i, stream);
|
||||||
HeuristicGpuCombinedTables.WarmUp(i, stream);
|
HeuristicCombinedGpuTables.WarmUp(i, stream);
|
||||||
// SmallPrimeFactorGpuTables.WarmUp(i, stream);
|
// SmallPrimeFactorGpuTables.WarmUp(i, stream);
|
||||||
// SharedHeuristicGpuTables.EnsureStaticTables(accelerator, stream);
|
// SharedHeuristicGpuTables.EnsureStaticTables(accelerator, stream);
|
||||||
// _ = GpuKernelPool.GetOrAddKernels(accelerator, stream, KernelType.None);
|
// _ = GpuKernelPool.GetOrAddKernels(accelerator, stream, KernelType.None);
|
||||||
@@ -111,8 +111,9 @@ public sealed class PrimeOrderCalculatorAccelerator
|
|||||||
public readonly MemoryBuffer1D<int, Stride1D.Dense> SmallPrimeFactorCountSlot;
|
public readonly MemoryBuffer1D<int, Stride1D.Dense> SmallPrimeFactorCountSlot;
|
||||||
public readonly MemoryBuffer1D<ulong, Stride1D.Dense> SpecialMaxResult;
|
public readonly MemoryBuffer1D<ulong, Stride1D.Dense> SpecialMaxResult;
|
||||||
|
|
||||||
public readonly HeuristicGpuCombinedDivisorTables DivisorTables;
|
public readonly HeuristicCombinedGpuViews DivisorTables;
|
||||||
public readonly SmallPrimeFactorGpuTables SmallPrimeFactorTables;
|
public readonly MemoryBuffer1D<uint, Stride1D.Dense> SmallPrimeFactorPrimes;
|
||||||
|
public readonly MemoryBuffer1D<ulong, Stride1D.Dense> SmallPrimeFactorSquares;
|
||||||
|
|
||||||
public readonly Kernel CheckFactorsKernel;
|
public readonly Kernel CheckFactorsKernel;
|
||||||
public readonly Kernel ConvertToStandardKernel;
|
public readonly Kernel ConvertToStandardKernel;
|
||||||
@@ -217,9 +218,13 @@ public sealed class PrimeOrderCalculatorAccelerator
|
|||||||
DevicePrimesPow2LastThree = lastDigitSharedTables.DevicePrimesPow2LastThree;
|
DevicePrimesPow2LastThree = lastDigitSharedTables.DevicePrimesPow2LastThree;
|
||||||
DevicePrimesPow2LastNine = lastDigitSharedTables.DevicePrimesPow2LastNine;
|
DevicePrimesPow2LastNine = lastDigitSharedTables.DevicePrimesPow2LastNine;
|
||||||
|
|
||||||
var heuristicSharedTables = HeuristicGpuCombinedTables.GetStaticTables(acceleratorIndex);
|
var heuristicSharedTables = HeuristicCombinedGpuTables.GetStaticTables(acceleratorIndex);
|
||||||
DivisorTables = heuristicSharedTables.CreateHeuristicDivisorTables();
|
|
||||||
SmallPrimeFactorTables = SmallPrimeFactorGpuTables.GetStaticTables(acceleratorIndex);
|
DivisorTables = heuristicSharedTables.CreateViews();
|
||||||
|
|
||||||
|
var smallPrimeFactorTables = SmallPrimeFactorGpuTables.GetStaticTables(acceleratorIndex);
|
||||||
|
SmallPrimeFactorPrimes = smallPrimeFactorTables.Primes;
|
||||||
|
SmallPrimeFactorSquares = smallPrimeFactorTables.Squares;
|
||||||
|
|
||||||
var checkFactorsKernel = accelerator.LoadStreamKernel<int, ulong, ArrayView1D<KeyValuePair<ulong, int>, Stride1D.Dense>, MontgomeryDivisorData, ArrayView1D<ulong, Stride1D.Dense>>(PrimeOrderGpuHeuristics.CheckFactorsKernel);
|
var checkFactorsKernel = accelerator.LoadStreamKernel<int, ulong, ArrayView1D<KeyValuePair<ulong, int>, Stride1D.Dense>, MontgomeryDivisorData, ArrayView1D<ulong, Stride1D.Dense>>(PrimeOrderGpuHeuristics.CheckFactorsKernel);
|
||||||
CheckFactorsKernel = KernelUtil.GetKernel(checkFactorsKernel);
|
CheckFactorsKernel = KernelUtil.GetKernel(checkFactorsKernel);
|
||||||
@@ -227,7 +232,7 @@ public sealed class PrimeOrderCalculatorAccelerator
|
|||||||
var convertKernel = accelerator.LoadAutoGroupedStreamKernel<Index1D, ArrayView1D<ulong, Stride1D.Dense>, MontgomeryDivisorData, ArrayView1D<ulong, Stride1D.Dense>>(Pow2MontgomeryKernels.Pow2MontgomeryKernelConvertToStandard);
|
var convertKernel = accelerator.LoadAutoGroupedStreamKernel<Index1D, ArrayView1D<ulong, Stride1D.Dense>, MontgomeryDivisorData, ArrayView1D<ulong, Stride1D.Dense>>(Pow2MontgomeryKernels.Pow2MontgomeryKernelConvertToStandard);
|
||||||
ConvertToStandardKernel = KernelUtil.GetKernel(convertKernel);
|
ConvertToStandardKernel = KernelUtil.GetKernel(convertKernel);
|
||||||
|
|
||||||
HeuristicCombinedTrialDivisionKernel = KernelUtil.GetKernel(accelerator.LoadAutoGroupedStreamKernel<Index1D, byte, ArrayView<int>, ulong, ulong, HeuristicGpuCombinedDivisorTables>(PrimeTesterKernels.HeuristicTrialCombinedDivisionKernel));
|
HeuristicCombinedTrialDivisionKernel = KernelUtil.GetKernel(accelerator.LoadAutoGroupedStreamKernel<Index1D, byte, ArrayView<int>, ulong, ulong, HeuristicCombinedGpuViews>(PrimeTesterKernels.HeuristicTrialCombinedDivisionKernel));
|
||||||
|
|
||||||
var keepKernel = accelerator.LoadAutoGroupedStreamKernel<Index1D, ArrayView1D<ulong, Stride1D.Dense>, MontgomeryDivisorData, ArrayView1D<ulong, Stride1D.Dense>>(Pow2MontgomeryKernels.Pow2MontgomeryKernelKeepMontgomery);
|
var keepKernel = accelerator.LoadAutoGroupedStreamKernel<Index1D, ArrayView1D<ulong, Stride1D.Dense>, MontgomeryDivisorData, ArrayView1D<ulong, Stride1D.Dense>>(Pow2MontgomeryKernels.Pow2MontgomeryKernelKeepMontgomery);
|
||||||
KeepMontgomeryKernel = KernelUtil.GetKernel(keepKernel);
|
KeepMontgomeryKernel = KernelUtil.GetKernel(keepKernel);
|
||||||
|
|||||||
+1
-1
@@ -4,7 +4,7 @@ using ILGPU.Runtime;
|
|||||||
|
|
||||||
namespace PerfectNumbers.Core.Gpu;
|
namespace PerfectNumbers.Core.Gpu;
|
||||||
|
|
||||||
public readonly struct HeuristicGpuCombinedDivisorTables(
|
public readonly struct HeuristicCombinedGpuViews(
|
||||||
ArrayView1D<ulong, Stride1D.Dense> combinedDivisorsEnding1,
|
ArrayView1D<ulong, Stride1D.Dense> combinedDivisorsEnding1,
|
||||||
ArrayView1D<ulong, Stride1D.Dense> combinedDivisorsEnding3,
|
ArrayView1D<ulong, Stride1D.Dense> combinedDivisorsEnding3,
|
||||||
ArrayView1D<ulong, Stride1D.Dense> combinedDivisorsEnding7,
|
ArrayView1D<ulong, Stride1D.Dense> combinedDivisorsEnding7,
|
||||||
+1
-1
@@ -4,7 +4,7 @@ using ILGPU.Runtime;
|
|||||||
|
|
||||||
namespace PerfectNumbers.Core.Gpu;
|
namespace PerfectNumbers.Core.Gpu;
|
||||||
|
|
||||||
public readonly struct HeuristicGpuGroupABDivisorTables(
|
public readonly struct HeuristicGroupABGpuViews(
|
||||||
ArrayView1D<ulong, Stride1D.Dense> groupADivisors,
|
ArrayView1D<ulong, Stride1D.Dense> groupADivisors,
|
||||||
ArrayView1D<ulong, Stride1D.Dense> groupADivisorSquares,
|
ArrayView1D<ulong, Stride1D.Dense> groupADivisorSquares,
|
||||||
ArrayView1D<ulong, Stride1D.Dense> groupBDivisorsEnding1,
|
ArrayView1D<ulong, Stride1D.Dense> groupBDivisorsEnding1,
|
||||||
@@ -83,7 +83,7 @@ internal static class PrimeTesterKernels
|
|||||||
ArrayView<int> resultFlag,
|
ArrayView<int> resultFlag,
|
||||||
ulong n,
|
ulong n,
|
||||||
ulong maxDivisorSquare,
|
ulong maxDivisorSquare,
|
||||||
HeuristicGpuCombinedDivisorTables tables)
|
HeuristicCombinedGpuViews tables)
|
||||||
{
|
{
|
||||||
// byte nMod10 = (byte)(n % 10UL);
|
// byte nMod10 = (byte)(n % 10UL);
|
||||||
ArrayView1D<ulong, Stride1D.Dense> divisors = tables.SelectDivisors(nMod10);
|
ArrayView1D<ulong, Stride1D.Dense> divisors = tables.SelectDivisors(nMod10);
|
||||||
@@ -116,7 +116,7 @@ internal static class PrimeTesterKernels
|
|||||||
ulong n,
|
ulong n,
|
||||||
ulong maxDivisorSquare,
|
ulong maxDivisorSquare,
|
||||||
HeuristicGpuDivisorTableKind tableKind,
|
HeuristicGpuDivisorTableKind tableKind,
|
||||||
HeuristicGpuGroupABDivisorTables tables)
|
HeuristicGroupABGpuViews tables)
|
||||||
{
|
{
|
||||||
ArrayView1D<ulong, Stride1D.Dense> divisors = tables.SelectDivisors(tableKind);
|
ArrayView1D<ulong, Stride1D.Dense> divisors = tables.SelectDivisors(tableKind);
|
||||||
ArrayView1D<ulong, Stride1D.Dense> divisorSquares = tables.SelectDivisorSquares(tableKind);
|
ArrayView1D<ulong, Stride1D.Dense> divisorSquares = tables.SelectDivisorSquares(tableKind);
|
||||||
|
|||||||
@@ -3,8 +3,8 @@ using ILGPU;
|
|||||||
using ILGPU.Runtime;
|
using ILGPU.Runtime;
|
||||||
|
|
||||||
namespace PerfectNumbers.Core.Gpu;
|
namespace PerfectNumbers.Core.Gpu;
|
||||||
|
|
||||||
public readonly struct SmallPrimeFactorGpuTables
|
public readonly struct SmallPrimeFactorGpuTables
|
||||||
|
|
||||||
{
|
{
|
||||||
private static readonly Accelerator[] _accelerators = AcceleratorPool.Shared.Accelerators;
|
private static readonly Accelerator[] _accelerators = AcceleratorPool.Shared.Accelerators;
|
||||||
private static readonly SmallPrimeFactorGpuTables[] _sharedTables = new SmallPrimeFactorGpuTables[PerfectNumberConstants.RollingAccelerators];
|
private static readonly SmallPrimeFactorGpuTables[] _sharedTables = new SmallPrimeFactorGpuTables[PerfectNumberConstants.RollingAccelerators];
|
||||||
|
|||||||
@@ -246,7 +246,7 @@ public sealed class HeuristicCombinedPrimeTester
|
|||||||
int compositeFlag = 0;
|
int compositeFlag = 0;
|
||||||
flagView1D.CopyFromCPU(stream, ref compositeFlag, 1);
|
flagView1D.CopyFromCPU(stream, ref compositeFlag, 1);
|
||||||
|
|
||||||
var kernelLauncher = kernel.CreateLauncherDelegate<Action<AcceleratorStream, Index1D, byte, ArrayView<int>, ulong, ulong, HeuristicGpuCombinedDivisorTables>>();
|
var kernelLauncher = kernel.CreateLauncherDelegate<Action<AcceleratorStream, Index1D, byte, ArrayView<int>, ulong, ulong, HeuristicCombinedGpuViews>>();
|
||||||
kernelLauncher(
|
kernelLauncher(
|
||||||
stream,
|
stream,
|
||||||
1,
|
1,
|
||||||
|
|||||||
@@ -261,7 +261,7 @@ public sealed class HeuristicPrimeTester
|
|||||||
// HeuristicGpuDivisorTableKind tableKind,
|
// HeuristicGpuDivisorTableKind tableKind,
|
||||||
// HeuristicGpuDivisorTables tables)
|
// HeuristicGpuDivisorTables tables)
|
||||||
|
|
||||||
var kernelLauncher = kernel.CreateLauncherDelegate<Action<AcceleratorStream, Index1D, byte, ArrayView<int>, ulong, ulong, HeuristicGpuDivisorTableKind, HeuristicGpuCombinedDivisorTables>>();
|
var kernelLauncher = kernel.CreateLauncherDelegate<Action<AcceleratorStream, Index1D, byte, ArrayView<int>, ulong, ulong, HeuristicGpuDivisorTableKind, HeuristicCombinedGpuViews>>();
|
||||||
kernelLauncher(
|
kernelLauncher(
|
||||||
stream,
|
stream,
|
||||||
1,
|
1,
|
||||||
|
|||||||
Reference in new issue
Block a user