コード例 #1
0
ファイル: VectorTests.cs プロジェクト: spinwards/jemalloc.NET
        private FixedBuffer <int> Mandelbrotv1Unmanaged()
        {
            SafeArray <Vector <float> > Vectors = new SafeArray <Vector <float> >(8);                                      // New unmanaged array of vectors
            FixedBuffer <int>           output  = new FixedBuffer <int>(((int)Mandelbrot_Width * (int)Mandelbrot_Height)); //New unmanaged array for bitmap output
            Span <float>   VectorSpan           = Vectors.GetSpan <float>();                                               //Lets us write to individual vector elements
            Span <Vector2> Vector2Span          = Vectors.GetSpan <Vector2>();                                             //Lets us read to individual vectors

            VectorSpan[0] = -2f;
            VectorSpan[1] = -1f;
            VectorSpan[2] = 1f;
            VectorSpan[3] = 1f;
            VectorSpan[4] = Mandelbrot_Width;
            VectorSpan[5] = Mandelbrot_Height;

            ref Vector2 C0 = ref Vector2Span[0];
コード例 #2
0
ファイル: UDTTests.cs プロジェクト: spinwards/jemalloc.NET
        public void CanVectorize()
        {
            Span <byte> s = Employees.GetSpan <byte>();

            int size = JemUtil.SizeOfStruct <TestUDT>();

            /*
             * for (int i = 0; i < Employees.Length; i+= size * Employees[i].)
             * {
             *
             *  //s.Slice
             *
             * }
             */
        }