Ejemplo n.º 1
0
 public void TestPrimitiveC4NnAsm(int h, int w, byte seed)
 {
     try
     {
         var sample = ArrayHelper.InitAllRand(h, w, seed);
         if (Avx2.IsSupported)
         {
             Console.WriteLine("Starting the C4 ASM...");
             Console.Out.Flush();
             var q = UnmanagedC4.TransformAsm(sample);
             Console.WriteLine("Done C4 ASM!");
             Console.Out.Flush();
             var p = C4NNUnsafeScalar(sample);
             TestHelper.AssertEqual(p, q);
         }
         else
         {
             Console.WriteLine("Avx2 support is not found, skipping the test");
         }
     } catch (Exception e)
     {
         Console.Error.WriteLine($"Caught exception:\n\t{e.Message}\nat\n{e.StackTrace}");
         Console.Error.Flush();
         throw e;
     }
 }
Ejemplo n.º 2
0
        public void TestPrimitiveC4NnCpp(int h, int w, byte seed)
        {
            var sample = ArrayHelper.InitAllRand(h, w, seed);
            var q      = UnmanagedC4.Transform(sample);
            var p      = C4NNUnsafeScalar(sample);

            TestHelper.AssertEqual(p, q);
        }