Cleanup & compilation fixes.
This commit is contained in:
1 parent
bc51962f9d
commit
56be12ab95
5 files changed
+15
-12
No files matched your search
+1
-1
@@ -2,7 +2,7 @@ using System.Runtime.CompilerServices;
|
||||
using ILGPU;
|
||||
using ILGPU.Runtime;
|
||||
|
||||
namespace PerfectNumbers.Core.Gpu;
|
||||
namespace PerfectNumbers.Core.Gpu.Accelerators;
|
||||
|
||||
public readonly struct HeuristicCombinedGpuViews(
|
||||
ArrayView1D<ulong, Stride1D.Dense> combinedDivisorsEnding1,
|
||||
+1
-1
@@ -2,7 +2,7 @@ using System.Runtime.CompilerServices;
|
||||
using ILGPU;
|
||||
using ILGPU.Runtime;
|
||||
|
||||
namespace PerfectNumbers.Core.Gpu;
|
||||
namespace PerfectNumbers.Core.Gpu.Accelerators;
|
||||
|
||||
public readonly struct HeuristicGroupABGpuViews(
|
||||
ArrayView1D<ulong, Stride1D.Dense> groupADivisors,
|
||||
@@ -2,6 +2,7 @@ using System.Runtime.CompilerServices;
|
||||
using ILGPU;
|
||||
using ILGPU.Algorithms;
|
||||
using ILGPU.Runtime;
|
||||
using PerfectNumbers.Core.Gpu.Accelerators;
|
||||
|
||||
namespace PerfectNumbers.Core.Gpu;
|
||||
|
||||
|
||||
@@ -172,7 +172,8 @@ internal static partial class PrimeOrderGpuHeuristics
|
||||
Accelerator accelerator = _accelerators[acceleratorIndex];
|
||||
AcceleratorStream stream = accelerator.CreateStream();
|
||||
|
||||
SmallPrimeFactorGpuTables cache = gpu.SmallPrimeFactorTables;
|
||||
var smallPrimesView = gpu.SmallPrimeFactorPrimes;
|
||||
var smallSquaresView = gpu.SmallPrimeFactorSquares;
|
||||
|
||||
// TODO: We should create / reallocate these buffer only once or if the new required length is bigger than capacity.
|
||||
MemoryBuffer1D<ulong, Stride1D.Dense>? factorBuffer = accelerator.Allocate1D<ulong>(primeTargets.Length);
|
||||
@@ -194,9 +195,9 @@ internal static partial class PrimeOrderGpuHeuristics
|
||||
stream,
|
||||
1,
|
||||
1,
|
||||
cache.Primes!.View,
|
||||
cache.Squares!.View,
|
||||
cache.Count,
|
||||
smallPrimesView,
|
||||
smallSquaresView,
|
||||
smallPrimesView.Length,
|
||||
primeTargets.Length,
|
||||
value,
|
||||
limit,
|
||||
@@ -336,7 +337,8 @@ internal static partial class PrimeOrderGpuHeuristics
|
||||
int acceleratorIndex = AcceleratorPool.Shared.Rent();
|
||||
Accelerator accelerator = _accelerators[acceleratorIndex];
|
||||
AcceleratorStream stream = AcceleratorStreamPool.Rent(acceleratorIndex);
|
||||
SmallPrimeFactorGpuTables cache = gpu.SmallPrimeFactorTables;
|
||||
var smallPrimesView = gpu.SmallPrimeFactorPrimes;
|
||||
var smallSquaresView = gpu.SmallPrimeFactorSquares;
|
||||
|
||||
// TODO: These buffers should be created reallocated once and assigned to an accelerator. Callers should use their own
|
||||
// thread static cache to prevent other threads from using taking accelerators with pre-allocated buffers if they don't
|
||||
@@ -403,9 +405,9 @@ internal static partial class PrimeOrderGpuHeuristics
|
||||
prime,
|
||||
kernelConfig,
|
||||
divisorData,
|
||||
cache.Primes!.View,
|
||||
cache.Squares!.View,
|
||||
cache.Count,
|
||||
smallPrimesView,
|
||||
smallSquaresView,
|
||||
smallPrimesView.Length,
|
||||
buffers);
|
||||
|
||||
|
||||
|
||||
@@ -77,8 +77,8 @@ internal static partial class PrimeOrderCalculator
|
||||
ArrayView1D<ulong, Stride1D.Dense> smallPrimeFactorRemainingSlotView = gpu.Input.View;
|
||||
ArrayView1D<ulong, Stride1D.Dense> smallPrimeFactorPrimeSlotsView = gpu.OutputUlong.View;
|
||||
ArrayView1D<int, Stride1D.Dense> smallPrimeFactorExponentSlotsView = gpu.OutputInt.View;
|
||||
ArrayView1D<uint, Stride1D.Dense> smallPrimeFactorsPrimesView = gpu.SmallPrimeFactorTables.Primes.View;
|
||||
ArrayView1D<ulong, Stride1D.Dense> smallPrimeFactorsSquaresView = gpu.SmallPrimeFactorTables.Squares.View;
|
||||
ArrayView1D<uint, Stride1D.Dense> smallPrimeFactorsPrimesView = gpu.SmallPrimeFactorPrimes;
|
||||
ArrayView1D<ulong, Stride1D.Dense> smallPrimeFactorsSquaresView = gpu.SmallPrimeFactorSquares;
|
||||
|
||||
kernelLauncher(
|
||||
stream,
|
||||
|
||||
Reference in new issue
Block a user