Return scalar MulMod results and benchmark native reducers

This commit is contained in:
Marek Lemańczyk committed 2025-10-01 00:41:27 +02:00
1 parent 4bbdebc874
commit 604e91b3e3
15 files changed
+1043 -261

No files matched your search

+2 -4
View File
@@ -215,16 +215,14 @@ public static class ULongExtensions
public static ulong MulMod64GpuCompatible(this ulong a, ulong b, ulong modulus)
{
GpuUInt128 state = new(a % modulus);
state.MulMod(b, modulus);
return state.Low;
return state.MulMod(b, modulus);
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static ulong MulMod64GpuCompatibleDeferred(this ulong a, ulong b, ulong modulus)
{
GpuUInt128 state = new(a);
state.MulModWithNativeModulo(b, modulus);
return state.Low;
return state.MulModWithNativeModulo(b, modulus);
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]