Refactor SPMD to HPC; add SIMD source generators

Major namespace migration from SPMD to HPC across all code, templates, and projects. Introduced Misaki.HighPerformance.HPC.Generator with Roslyn-based source generators for SIMD code (e.g., AVX2), including attribute and method generators. Renamed MultipleAdd to MultiplyAdd in all lanes and updated usages. Added AVX2 utility methods via codegen. Updated tests, benchmarks, and project references to use the new framework. Improved SIMD memory utilities and modernized project files. Removed legacy SPMD project from the solution.
This commit is contained in:
2026-05-06 13:43:58 +09:00
parent d3e497c7d8
commit c8f78f9d02
36 changed files with 895 additions and 130 deletions

View File

@@ -1,5 +1,6 @@
using Misaki.HighPerformance.Mathematics.SPMD;
using Misaki.HighPerformance.HPC;
using System.Numerics;
using System.Runtime.Intrinsics.X86;
namespace Misaki.HighPerformance.Test.UnitTest.Jobs;

View File

@@ -1,6 +1,6 @@
using Misaki.HighPerformance.Jobs;
using Misaki.HighPerformance.Mathematics;
using Misaki.HighPerformance.Mathematics.SPMD;
using Misaki.HighPerformance.HPC;
using System.Runtime.InteropServices;
namespace Misaki.HighPerformance.Test.UnitTest.Jobs;
@@ -116,8 +116,26 @@ internal struct DistanceJob : IJobSPMD<float>
}
[TestClass]
public class SPMDTest
public partial class SPMDTest
{
[HPCompute(TargetInstructionSet.AVX2)]
private static WideLane<float> Test(WideLane<float> a, WideLane<float> b, WideLane<float> c)
{
return WideLane<float>.MultiplyAdd(a, b, c);
}
[HPCompute(TargetInstructionSet.AVX2)]
private static (TFloat, TFloat) Test_SPMD<TFloat>(TFloat a, TFloat b, TFloat c)
where TFloat : unmanaged, ISPMDLane<TFloat, float>
{
var u = TFloat.Atan2(a, b);
var v = TFloat.Asin(c);
u = u / (2.0f * 3.14159265358979323846f) + 0.5f;
v = v / 3.14159265358979323846f + 0.5f;
return (u, v);
}
[TestMethod]
public unsafe void TestSPMDVectorDot()
{

View File

@@ -2,7 +2,7 @@ using Misaki.HighPerformance.Jobs;
using Misaki.HighPerformance.LowLevel.Buffer;
using Misaki.HighPerformance.LowLevel.Collections;
using Misaki.HighPerformance.LowLevel.Utilities;
using Misaki.HighPerformance.Mathematics.SPMD;
using Misaki.HighPerformance.HPC;
using Misaki.HighPerformance.Test.Jobs;
namespace Misaki.HighPerformance.Test.UnitTest.Jobs;