Example #1
0
        public AlternatingBinaryOpTest__AddSubtractSingle()
        {
            Succeeded = true;

            for (var i = 0; i < Op1ElementCount; i++)
            {
                _data1[i] = TestLibrary.Generator.GetSingle();
            }
            Unsafe.CopyBlockUnaligned(ref Unsafe.As <Vector128 <Single>, byte>(ref _fld1), ref Unsafe.As <Single, byte>(ref _data1[0]), (uint)Unsafe.SizeOf <Vector128 <Single> >());
            for (var i = 0; i < Op2ElementCount; i++)
            {
                _data2[i] = TestLibrary.Generator.GetSingle();
            }
            Unsafe.CopyBlockUnaligned(ref Unsafe.As <Vector128 <Single>, byte>(ref _fld2), ref Unsafe.As <Single, byte>(ref _data2[0]), (uint)Unsafe.SizeOf <Vector128 <Single> >());

            for (var i = 0; i < Op1ElementCount; i++)
            {
                _data1[i] = TestLibrary.Generator.GetSingle();
            }
            for (var i = 0; i < Op2ElementCount; i++)
            {
                _data2[i] = TestLibrary.Generator.GetSingle();
            }
            _dataTable = new AlternatingBinaryOpTest__DataTable <Single, Single, Single>(_data1, _data2, new Single[RetElementCount], LargestVectorSize);
        }
Example #2
0
        public AlternatingBinaryOpTest__AddSubtractSingle()
        {
            Succeeded = true;

            var random = new Random();

            for (var i = 0; i < Op1ElementCount; i++)
            {
                _data1[i] = (float)(random.NextDouble());
            }
            Unsafe.CopyBlockUnaligned(ref Unsafe.As <Vector128 <Single>, byte>(ref _fld1), ref Unsafe.As <Single, byte>(ref _data1[0]), VectorSize);
            for (var i = 0; i < Op2ElementCount; i++)
            {
                _data2[i] = (float)(random.NextDouble());
            }
            Unsafe.CopyBlockUnaligned(ref Unsafe.As <Vector128 <Single>, byte>(ref _fld2), ref Unsafe.As <Single, byte>(ref _data2[0]), VectorSize);

            for (var i = 0; i < Op1ElementCount; i++)
            {
                _data1[i] = (float)(random.NextDouble());
            }
            for (var i = 0; i < Op2ElementCount; i++)
            {
                _data2[i] = (float)(random.NextDouble());
            }
            _dataTable = new AlternatingBinaryOpTest__DataTable <Single, Single, Single>(_data1, _data2, new Single[RetElementCount], VectorSize);
        }