Example #1
0
        unsafe static void Main(string[] args)
        {
            using (AlignedBlock block = new AlignedBlock(SIMDVector4.Sizeof, AlignedBlock.PageSize / SIMDVector4.Sizeof))
            {
                SIMDVector4 a = SIMDVector4.Create(block[0], 1, 2, 3, 4);
                SIMDVector4 b = SIMDVector4.Create(block[1], 1, 2, 3, 4);
                SIMDVector4 c = SIMDVector4.Create(block[2], 5, 6, 7, 8);
                SIMDVector4 d = a * b * c;
                Console.WriteLine(d.ToString());
            }

            Console.ReadLine();
        }
        unsafe static void Main(string[] args)
        {
            using (AlignedBlock block = new AlignedBlock(SIMDVector4.Sizeof, AlignedBlock.AllocationGranularity / SIMDVector4.Sizeof))
            {
                for (int index = 0; index < block.Count; index++)
                {
                    SIMDVector4.Create(block[index], 1, 2, 3, 4);
                }

                SIMDVector4 a = SIMDVector4.Create(block[0], 1, 2, 3, 4);
                SIMDVector4 b = SIMDVector4.Create(block[1], 1, 2, 3, 4);
                SIMDVector4 c = SIMDVector4.Create(block[2], 5, 6, 7, 8);
                SIMDVector4 d = a * b * c;
                Console.WriteLine(d.ToString());
            }

            Console.ReadLine();
        }