mat queue and mat predictor confuses. i need time to design and organize

This commit is contained in:
Youmu Liu
2026-05-06 18:07:31 +08:00
parent 1338bf2801
commit e636410ba6
5 changed files with 112 additions and 42 deletions
@@ -2,8 +2,8 @@
// -----------------------------------------------------------------------
// file="IntrinsicContext"
// Project: StgSharp
// AuthorGroup: Nitload Space
// Copyright (c) Nitload Space. All rights reserved.
// AuthorGroup: Nitload
// Copyright (c) Nitload. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@@ -68,7 +68,9 @@ namespace StgSharp.Mathematics.Internal
[FieldOffset(0)] public readonly ushort Size;
private MatrixElementType(int mask)
private MatrixElementType(
int mask
)
{
Unsafe.SkipInit(out this);
Unsafe.SkipInit(out Size);
@@ -76,6 +78,24 @@ namespace StgSharp.Mathematics.Internal
this.Mask = mask;
}
[Obsolete("Do not use this constructor. Use pre-defined ones from static fields.", true)]
public MatrixElementType()
{
throw new NotSupportedException("Do not use this constructor. Use pre-defined ones from static fields.");
}
public override readonly bool Equals(
object? obj
)
{
return (obj is MatrixElementType type) && (Mask == type.Mask);
}
public override readonly int GetHashCode()
{
return Mask;
}
}
[StructLayout(LayoutKind.Sequential)]
@@ -105,14 +125,19 @@ namespace StgSharp.Mathematics.Internal
private nint handle; //f32_panel_mul
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public readonly void Call(MatrixIntrinsicHandle index, MatrixParallelTask* task)
public readonly void Call(
MatrixIntrinsicHandle index,
MatrixParallelTask* task
)
{
nint ptr = this[(int)index];
((delegate* unmanaged[Cdecl]<MatrixParallelTask*, void>)ptr)(task);
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public readonly nint Get(MatrixIntrinsicHandle index)
public readonly nint Get(
MatrixIntrinsicHandle index
)
{
return this[(int)index];
}
@@ -143,15 +168,20 @@ namespace StgSharp.Mathematics.Internal
MatrixKernel* left,
MatrixKernel* right,
MatrixKernel* ans,
ulong scalar)
ulong scalar
)
{
nint ptr = this[(int)index];
((delegate* unmanaged[Cdecl]<MatrixKernel*, MatrixKernel*, MatrixKernel*, ulong, void>)ptr)(left, right,
ans, scalar);
((delegate* unmanaged[Cdecl]<MatrixKernel*, MatrixKernel*, MatrixKernel*, ulong, void>)ptr)(left,
right,
ans,
scalar);
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public readonly nint Get(MatrixIntrinsicHandle index)
public readonly nint Get(
MatrixIntrinsicHandle index
)
{
return this[(int)index];
}