Esempio n. 1
0
        public void ReadWriteBufferSetRangeData()
        {
            float[] array = Enumerable.Range(0, 256).Select(i => (float)i).ToArray();

            using ReadWriteBuffer <float> sourceBuffer = Gpu.Default.AllocateReadWriteBuffer(array);

            array.AsSpan(56, 100).Clear();
            sourceBuffer.SetData(new float[100], 56, 100);

            float[] sourceResult = sourceBuffer.GetData();

            Assert.IsTrue(array.AsSpan().ContentEquals(sourceResult));
        }