small size buffer op ok
This commit is contained in:
+14
-18
@@ -31,6 +31,7 @@ using StgSharp.Geometries;
|
||||
using StgSharp.Graphics;
|
||||
using StgSharp.HighPerformance;
|
||||
using StgSharp.HighPerformance.Memory;
|
||||
using StgSharp.Internal;
|
||||
using StgSharp.Mathematics;
|
||||
using StgSharp.Mathematics.Graphic;
|
||||
using StgSharp.Mathematics.Numeric;
|
||||
@@ -60,9 +61,9 @@ namespace StgSharp
|
||||
{
|
||||
try
|
||||
{
|
||||
World.Init();
|
||||
|
||||
World.Initialize().UseModule<NumericalModule>().UseModule<GraphicModule>().InitializeModule();
|
||||
|
||||
/*
|
||||
// New test with synchronized start:
|
||||
// - 8 producer threads, each pushing 1000 unique integers
|
||||
// - 8 consumer threads, each attempting to pop 1000 times
|
||||
@@ -155,7 +156,7 @@ namespace StgSharp
|
||||
}
|
||||
|
||||
Console.WriteLine($"Popped count: {popped.Count}");
|
||||
/**/
|
||||
/*
|
||||
Console.WriteLine("Popped values:");
|
||||
foreach (int v in popped)
|
||||
{
|
||||
@@ -163,7 +164,7 @@ namespace StgSharp
|
||||
Console.Write('\t');
|
||||
}
|
||||
Console.WriteLine();
|
||||
/**/
|
||||
/*
|
||||
Console.WriteLine($"Remaining count: {remaining.Count}");
|
||||
Console.WriteLine("Remaining values:");
|
||||
foreach (int v in remaining)
|
||||
@@ -176,28 +177,23 @@ namespace StgSharp
|
||||
// Sanity check
|
||||
Console.WriteLine($"Produced: {producerThreads * perProducer}, Popped+Remaining: {popped.Count + remaining.Count}");
|
||||
|
||||
/*
|
||||
// TestMatrixParallel();
|
||||
/**/
|
||||
|
||||
// 原有的矩阵测试代码
|
||||
HybridLayerSegregatedFitAllocator hlsf = new HybridLayerSegregatedFitAllocator(64 * 400 * 400);
|
||||
|
||||
Matrix<float> m = Matrix<float>.FromHlsf(400, 200, hlsf);
|
||||
|
||||
int i = 0, ii = 0;
|
||||
|
||||
foreach (MatrixSegment<float> lines in m.GetRowEnumeration())
|
||||
Matrix<float> m = Matrix<float>.FromHlsf(20, 20, hlsf);
|
||||
m.Fill(1.0f);
|
||||
Matrix<float> n = m.Add(m);
|
||||
for (int i = 0; i < 20; i++)
|
||||
{
|
||||
i = 0;
|
||||
foreach (MatrixKernel<float>* item in lines)
|
||||
{
|
||||
i++;
|
||||
Console.WriteLine(i);
|
||||
for (int j = 0; j < 20; j++) {
|
||||
Console.Write($"{n[i, j].ToString("0.000")}\t");
|
||||
}
|
||||
ii++;
|
||||
Console.WriteLine($"============================{ii}");
|
||||
Console.WriteLine();
|
||||
}
|
||||
/**/
|
||||
/**/
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user