Esempio n. 1
0
        static unsafe int Main()
        {
            int testResult = Pass;

            if (Avx.IsSupported)
            {
                fixed(float *ptr = new float[8] {
                    1, -5, 100, 0, 2, 30, -6, 42
                })
                {
                    var v = Unsafe.Read <Vector256 <float> >(ptr);
                    var f = Avx.ConvertToSingle(v);

                    if (f != ptr[0])
                    {
                        Console.WriteLine("AVX ConvertToSingle failed on float:");
                        Console.WriteLine(f);
                        testResult = Fail;
                    }
                }
            }

            return(testResult);
        }