public SimpleBinaryOpTest__MultiplyScalarDouble() { Succeeded = true; var random = new Random(); for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = (double)(random.NextDouble()); } Unsafe.CopyBlockUnaligned(ref Unsafe.As <Vector128 <Double>, byte>(ref _fld1), ref Unsafe.As <Double, byte>(ref _data1[0]), VectorSize); for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = (double)(random.NextDouble()); } Unsafe.CopyBlockUnaligned(ref Unsafe.As <Vector128 <Double>, byte>(ref _fld2), ref Unsafe.As <Double, byte>(ref _data2[0]), VectorSize); for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = (double)(random.NextDouble()); } for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = (double)(random.NextDouble()); } _dataTable = new SimpleBinaryOpTest__DataTable <Double, Double, Double>(_data1, _data2, new Double[RetElementCount], VectorSize); }
public SimpleBinaryOpTest__SubtractSaturateInt16() { Succeeded = true; for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } Unsafe.CopyBlockUnaligned(ref Unsafe.As <Vector128 <Int16>, byte>(ref _fld1), ref Unsafe.As <Int16, byte>(ref _data1[0]), (uint)Unsafe.SizeOf <Vector128 <Int16> >()); for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } Unsafe.CopyBlockUnaligned(ref Unsafe.As <Vector128 <Int16>, byte>(ref _fld2), ref Unsafe.As <Int16, byte>(ref _data2[0]), (uint)Unsafe.SizeOf <Vector128 <Int16> >()); for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } _dataTable = new SimpleBinaryOpTest__DataTable <Int16, Int16, Int16>(_data1, _data2, new Int16[RetElementCount], LargestVectorSize); }
public InsertLoadTest__InsertVector128Int641() { Succeeded = true; for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } Unsafe.CopyBlockUnaligned(ref Unsafe.As <Vector256 <Int64>, byte>(ref _fld1), ref Unsafe.As <Int64, byte>(ref _data1[0]), (uint)Unsafe.SizeOf <Vector256 <Int64> >()); for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } Unsafe.CopyBlockUnaligned(ref Unsafe.As <Vector128 <Int64>, byte>(ref _fld2), ref Unsafe.As <Int64, byte>(ref _data2[0]), (uint)Unsafe.SizeOf <Vector128 <Int64> >()); for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } _dataTable = new SimpleBinaryOpTest__DataTable <Int64, Int64, Int64>(_data1, _data2, new Int64[RetElementCount], LargestVectorSize); }
public SimpleBinaryOpTest__CompareEqualSByte() { Succeeded = true; var random = new Random(); for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = (sbyte)(random.Next(sbyte.MinValue, sbyte.MaxValue)); } Unsafe.CopyBlockUnaligned(ref Unsafe.As <Vector256 <SByte>, byte>(ref _fld1), ref Unsafe.As <SByte, byte>(ref _data1[0]), (uint)Unsafe.SizeOf <Vector256 <SByte> >()); for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = (sbyte)(random.Next(sbyte.MinValue, sbyte.MaxValue)); } Unsafe.CopyBlockUnaligned(ref Unsafe.As <Vector256 <SByte>, byte>(ref _fld2), ref Unsafe.As <SByte, byte>(ref _data2[0]), (uint)Unsafe.SizeOf <Vector256 <SByte> >()); for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = (sbyte)(random.Next(sbyte.MinValue, sbyte.MaxValue)); } for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = (sbyte)(random.Next(sbyte.MinValue, sbyte.MaxValue)); } _dataTable = new SimpleBinaryOpTest__DataTable <SByte, SByte, SByte>(_data1, _data2, new SByte[RetElementCount], LargestVectorSize); }
public ImmBinaryOpTest__AlignRightSByte228() { Succeeded = true; for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } Unsafe.CopyBlockUnaligned(ref Unsafe.As <Vector256 <SByte>, byte>(ref _fld1), ref Unsafe.As <SByte, byte>(ref _data1[0]), (uint)Unsafe.SizeOf <Vector256 <SByte> >()); for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } Unsafe.CopyBlockUnaligned(ref Unsafe.As <Vector256 <SByte>, byte>(ref _fld2), ref Unsafe.As <SByte, byte>(ref _data2[0]), (uint)Unsafe.SizeOf <Vector256 <SByte> >()); for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } _dataTable = new SimpleBinaryOpTest__DataTable <SByte, SByte, SByte>(_data1, _data2, new SByte[RetElementCount], LargestVectorSize); }
public SimpleBinaryOpTest__OrUInt64() { Succeeded = true; var random = new Random(); for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = (ulong)(random.Next(0, int.MaxValue)); } Unsafe.CopyBlockUnaligned(ref Unsafe.As <Vector128 <UInt64>, byte>(ref _fld1), ref Unsafe.As <UInt64, byte>(ref _data1[0]), (uint)Unsafe.SizeOf <Vector128 <UInt64> >()); for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = (ulong)(random.Next(0, int.MaxValue)); } Unsafe.CopyBlockUnaligned(ref Unsafe.As <Vector128 <UInt64>, byte>(ref _fld2), ref Unsafe.As <UInt64, byte>(ref _data2[0]), (uint)Unsafe.SizeOf <Vector128 <UInt64> >()); for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = (ulong)(random.Next(0, int.MaxValue)); } for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = (ulong)(random.Next(0, int.MaxValue)); } _dataTable = new SimpleBinaryOpTest__DataTable <UInt64, UInt64, UInt64>(_data1, _data2, new UInt64[RetElementCount], LargestVectorSize); }
public ImmBinaryOpTest__BlendInt322() { Succeeded = true; var random = new Random(); for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = (int)(random.Next(int.MinValue, int.MaxValue)); } Unsafe.CopyBlockUnaligned(ref Unsafe.As <Vector256 <Int32>, byte>(ref _fld1), ref Unsafe.As <Int32, byte>(ref _data1[0]), (uint)Unsafe.SizeOf <Vector256 <Int32> >()); for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = (int)(random.Next(int.MinValue, int.MaxValue)); } Unsafe.CopyBlockUnaligned(ref Unsafe.As <Vector256 <Int32>, byte>(ref _fld2), ref Unsafe.As <Int32, byte>(ref _data2[0]), (uint)Unsafe.SizeOf <Vector256 <Int32> >()); for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = (int)(random.Next(int.MinValue, int.MaxValue)); } for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = (int)(random.Next(int.MinValue, int.MaxValue)); } _dataTable = new SimpleBinaryOpTest__DataTable <Int32, Int32, Int32>(_data1, _data2, new Int32[RetElementCount], LargestVectorSize); }
public SimpleBinaryOpTest__AndUInt32() { Succeeded = true; for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } Unsafe.CopyBlockUnaligned(ref Unsafe.As <Vector128 <UInt32>, byte>(ref _fld1), ref Unsafe.As <UInt32, byte>(ref _data1[0]), (uint)Unsafe.SizeOf <Vector128 <UInt32> >()); for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } Unsafe.CopyBlockUnaligned(ref Unsafe.As <Vector128 <UInt32>, byte>(ref _fld2), ref Unsafe.As <UInt32, byte>(ref _data2[0]), (uint)Unsafe.SizeOf <Vector128 <UInt32> >()); for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } _dataTable = new SimpleBinaryOpTest__DataTable <UInt32, UInt32, UInt32>(_data1, _data2, new UInt32[RetElementCount], LargestVectorSize); }
public SimpleBinaryOpTest__AndNotUInt16() { Succeeded = true; var random = new Random(); for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = (ushort)(random.Next(0, ushort.MaxValue)); } Unsafe.CopyBlockUnaligned(ref Unsafe.As <Vector128 <UInt16>, byte>(ref _fld1), ref Unsafe.As <UInt16, byte>(ref _data1[0]), VectorSize); for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = (ushort)(random.Next(0, ushort.MaxValue)); } Unsafe.CopyBlockUnaligned(ref Unsafe.As <Vector128 <UInt16>, byte>(ref _fld2), ref Unsafe.As <UInt16, byte>(ref _data2[0]), VectorSize); for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = (ushort)(random.Next(0, ushort.MaxValue)); } for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = (ushort)(random.Next(0, ushort.MaxValue)); } _dataTable = new SimpleBinaryOpTest__DataTable <UInt16, UInt16, UInt16>(_data1, _data2, new UInt16[RetElementCount], VectorSize); }
public SimpleBinaryOpTest__CompareScalarOrderedSingle() { 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 SimpleBinaryOpTest__DataTable <Single, Single, Single>(_data1, _data2, new Single[RetElementCount], LargestVectorSize); }
public SimpleBinaryOpTest__CompareNotGreaterThanOrEqualSingle() { 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 SimpleBinaryOpTest__DataTable <Single, Single, Single>(_data1, _data2, new Single[RetElementCount], VectorSize); }
public SimpleBinaryOpTest__InsertVector128UInt321() { Succeeded = true; var random = new Random(); for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = (uint)(random.Next(0, int.MaxValue)); } Unsafe.CopyBlockUnaligned(ref Unsafe.As <Vector256 <UInt32>, byte>(ref _fld1), ref Unsafe.As <UInt32, byte>(ref _data1[0]), VectorSize); for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = (uint)(random.Next(0, int.MaxValue)); } Unsafe.CopyBlockUnaligned(ref Unsafe.As <Vector128 <UInt32>, byte>(ref _fld2), ref Unsafe.As <UInt32, byte>(ref _data2[0]), VectorSize); for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = (uint)(random.Next(0, int.MaxValue)); } for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = (uint)(random.Next(0, int.MaxValue)); } _dataTable = new SimpleBinaryOpTest__DataTable <UInt32, UInt32, UInt32>(_data1, _data2, new UInt32[RetElementCount], VectorSize); }
public SimpleBinaryOpTest__CompareGreaterThanInt64() { Succeeded = true; var random = new Random(); for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = (long)(random.Next(int.MinValue, int.MaxValue)); } Unsafe.CopyBlockUnaligned(ref Unsafe.As <Vector128 <Int64>, byte>(ref _fld1), ref Unsafe.As <Int64, byte>(ref _data1[0]), VectorSize); for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = (long)(random.Next(int.MinValue, int.MaxValue)); } Unsafe.CopyBlockUnaligned(ref Unsafe.As <Vector128 <Int64>, byte>(ref _fld2), ref Unsafe.As <Int64, byte>(ref _data2[0]), VectorSize); for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = (long)(random.Next(int.MinValue, int.MaxValue)); } for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = (long)(random.Next(int.MinValue, int.MaxValue)); } _dataTable = new SimpleBinaryOpTest__DataTable <Int64, Int64, Int64>(_data1, _data2, new Int64[RetElementCount], VectorSize); }
public SimpleBinaryOpTest__MinScalarSingle() { 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]), (uint)Unsafe.SizeOf <Vector128 <Single> >()); 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]), (uint)Unsafe.SizeOf <Vector128 <Single> >()); 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 SimpleBinaryOpTest__DataTable <Single, Single, Single>(_data1, _data2, new Single[RetElementCount], LargestVectorSize); }
public SimpleBinaryOpTest__InsertVector128Int161Load() { Succeeded = true; var random = new Random(); for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = (short)(random.Next(0, short.MaxValue)); } Unsafe.CopyBlockUnaligned(ref Unsafe.As <Vector256 <Int16>, byte>(ref _fld1), ref Unsafe.As <Int16, byte>(ref _data1[0]), (uint)Unsafe.SizeOf <Vector256 <Int16> >()); for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = (short)(random.Next(0, short.MaxValue)); } Unsafe.CopyBlockUnaligned(ref Unsafe.As <Vector128 <Int16>, byte>(ref _fld2), ref Unsafe.As <Int16, byte>(ref _data2[0]), (uint)Unsafe.SizeOf <Vector128 <Int16> >()); for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = (short)(random.Next(0, short.MaxValue)); } for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = (short)(random.Next(0, short.MaxValue)); } _dataTable = new SimpleBinaryOpTest__DataTable <Int16, Int16, Int16>(_data1, _data2, new Int16[RetElementCount], LargestVectorSize); }
public SimpleBinaryOpTest__MultiplyDouble() { Succeeded = true; var random = new Random(); for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } Unsafe.CopyBlockUnaligned(ref Unsafe.As <Vector256 <Double>, byte>(ref _fld1), ref Unsafe.As <Double, byte>(ref _data1[0]), (uint)Unsafe.SizeOf <Vector256 <Double> >()); for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } Unsafe.CopyBlockUnaligned(ref Unsafe.As <Vector256 <Double>, byte>(ref _fld2), ref Unsafe.As <Double, byte>(ref _data2[0]), (uint)Unsafe.SizeOf <Vector256 <Double> >()); for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } _dataTable = new SimpleBinaryOpTest__DataTable <Double, Double, Double>(_data1, _data2, new Double[RetElementCount], LargestVectorSize); }
public SimpleBinaryOpTest__AndByte() { Succeeded = true; var random = new Random(); for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = (byte)(random.Next(0, byte.MaxValue)); } Unsafe.CopyBlockUnaligned(ref Unsafe.As <Vector128 <Byte>, byte>(ref _fld1), ref Unsafe.As <Byte, byte>(ref _data1[0]), VectorSize); for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = (byte)(random.Next(0, byte.MaxValue)); } Unsafe.CopyBlockUnaligned(ref Unsafe.As <Vector128 <Byte>, byte>(ref _fld2), ref Unsafe.As <Byte, byte>(ref _data2[0]), VectorSize); for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = (byte)(random.Next(0, byte.MaxValue)); } for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = (byte)(random.Next(0, byte.MaxValue)); } _dataTable = new SimpleBinaryOpTest__DataTable <Byte, Byte, Byte>(_data1, _data2, new Byte[RetElementCount], VectorSize); }
public SimpleBinaryOpTest__MultiplyAddAdjacentInt16() { Succeeded = true; var random = new Random(); for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = (byte)(random.Next(0, byte.MaxValue)); } Unsafe.CopyBlockUnaligned(ref Unsafe.As <Vector128 <Byte>, byte>(ref _fld1), ref Unsafe.As <Byte, byte>(ref _data1[0]), (uint)Unsafe.SizeOf <Vector128 <Byte> >()); for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = (sbyte)(random.Next(sbyte.MinValue, sbyte.MaxValue)); } Unsafe.CopyBlockUnaligned(ref Unsafe.As <Vector128 <SByte>, byte>(ref _fld2), ref Unsafe.As <SByte, byte>(ref _data2[0]), (uint)Unsafe.SizeOf <Vector128 <SByte> >()); for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = (byte)(random.Next(0, byte.MaxValue)); } for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = (sbyte)(random.Next(sbyte.MinValue, sbyte.MaxValue)); } _dataTable = new SimpleBinaryOpTest__DataTable <Int16, Byte, SByte>(_data1, _data2, new Int16[RetElementCount], LargestVectorSize); }
public PclmulqdqOpTest__CarrylessMultiplyInt641() { Succeeded = true; Unsafe.CopyBlockUnaligned(ref Unsafe.As <Vector128 <Int64>, byte>(ref _fld1), ref Unsafe.As <Int64, byte>(ref _data1[0]), (uint)Unsafe.SizeOf <Vector128 <Int64> >()); Unsafe.CopyBlockUnaligned(ref Unsafe.As <Vector128 <Int64>, byte>(ref _fld2), ref Unsafe.As <Int64, byte>(ref _data2[0]), (uint)Unsafe.SizeOf <Vector128 <Int64> >()); _dataTable = new SimpleBinaryOpTest__DataTable <Int64, Int64, Int64>(_data1, _data2, new Int64[RetElementCount], LargestVectorSize); }
public AesBinaryOpTest__EncryptByte() { Succeeded = true; Unsafe.CopyBlockUnaligned(ref Unsafe.As <Vector128 <Byte>, byte>(ref _fld1), ref Unsafe.As <Byte, byte>(ref _data1[0]), (uint)Unsafe.SizeOf <Vector128 <Byte> >()); Unsafe.CopyBlockUnaligned(ref Unsafe.As <Vector128 <Byte>, byte>(ref _fld2), ref Unsafe.As <Byte, byte>(ref _data2[0]), (uint)Unsafe.SizeOf <Vector128 <Byte> >()); _dataTable = new SimpleBinaryOpTest__DataTable <Byte, Byte, Byte>(_data1, _data2, new Byte[RetElementCount], LargestVectorSize); }
public SimpleBinaryOpTest__AddScalarSingle() { Succeeded = true; var random = new Random(); for (var i = 0; i < ElementCount; i++) { _data1[i] = (float)(random.NextDouble()); _data2[i] = (float)(random.NextDouble()); } Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Single>, byte>(ref _fld1), ref Unsafe.As<Single, byte>(ref _data1[0]), VectorSize); Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Single>, byte>(ref _fld2), ref Unsafe.As<Single, byte>(ref _data2[0]), VectorSize); for (var i = 0; i < ElementCount; i++) { _data1[i] = (float)(random.NextDouble()); _data2[i] = (float)(random.NextDouble()); } _dataTable = new SimpleBinaryOpTest__DataTable<Single>(_data1, _data2, new Single[ElementCount]); }
public SimpleBinaryOpTest__AddSByte() { Succeeded = true; var random = new Random(); for (var i = 0; i < ElementCount; i++) { _data1[i] = (sbyte)(random.Next(sbyte.MinValue, sbyte.MaxValue)); _data2[i] = (sbyte)(random.Next(sbyte.MinValue, sbyte.MaxValue)); } Unsafe.CopyBlockUnaligned(ref Unsafe.As <Vector128 <SByte>, byte>(ref _fld1), ref Unsafe.As <SByte, byte>(ref _data1[0]), VectorSize); Unsafe.CopyBlockUnaligned(ref Unsafe.As <Vector128 <SByte>, byte>(ref _fld2), ref Unsafe.As <SByte, byte>(ref _data2[0]), VectorSize); for (var i = 0; i < ElementCount; i++) { _data1[i] = (sbyte)(random.Next(sbyte.MinValue, sbyte.MaxValue)); _data2[i] = (sbyte)(random.Next(sbyte.MinValue, sbyte.MaxValue)); } _dataTable = new SimpleBinaryOpTest__DataTable <SByte>(_data1, _data2, new SByte[ElementCount], VectorSize); }
public SimpleBinaryOpTest__XorInt16() { Succeeded = true; var random = new Random(); for (var i = 0; i < ElementCount; i++) { _data1[i] = (short)(random.Next(short.MinValue, short.MaxValue)); _data2[i] = (short)(random.Next(short.MinValue, short.MaxValue)); } Unsafe.CopyBlockUnaligned(ref Unsafe.As <Vector256 <Int16>, byte>(ref _fld1), ref Unsafe.As <Int16, byte>(ref _data1[0]), VectorSize); Unsafe.CopyBlockUnaligned(ref Unsafe.As <Vector256 <Int16>, byte>(ref _fld2), ref Unsafe.As <Int16, byte>(ref _data2[0]), VectorSize); for (var i = 0; i < ElementCount; i++) { _data1[i] = (short)(random.Next(short.MinValue, short.MaxValue)); _data2[i] = (short)(random.Next(short.MinValue, short.MaxValue)); } _dataTable = new SimpleBinaryOpTest__DataTable <Int16>(_data1, _data2, new Int16[ElementCount], VectorSize); }
public SimpleBinaryOpTest__SubtractUInt64() { Succeeded = true; var random = new Random(); for (var i = 0; i < ElementCount; i++) { _data1[i] = (ulong)(random.Next(0, int.MaxValue)); _data2[i] = (ulong)(random.Next(0, int.MaxValue)); } Unsafe.CopyBlockUnaligned(ref Unsafe.As <Vector256 <UInt64>, byte>(ref _fld1), ref Unsafe.As <UInt64, byte>(ref _data1[0]), VectorSize); Unsafe.CopyBlockUnaligned(ref Unsafe.As <Vector256 <UInt64>, byte>(ref _fld2), ref Unsafe.As <UInt64, byte>(ref _data2[0]), VectorSize); for (var i = 0; i < ElementCount; i++) { _data1[i] = (ulong)(random.Next(0, int.MaxValue)); _data2[i] = (ulong)(random.Next(0, int.MaxValue)); } _dataTable = new SimpleBinaryOpTest__DataTable <UInt64>(_data1, _data2, new UInt64[ElementCount], VectorSize); }
public SimpleBinaryOpTest__CompareLessThanOrEqualDouble() { Succeeded = true; var random = new Random(); for (var i = 0; i < ElementCount; i++) { _data1[i] = (double)(random.NextDouble()); _data2[i] = (double)(random.NextDouble()); } Unsafe.CopyBlockUnaligned(ref Unsafe.As <Vector128 <Double>, byte>(ref _fld1), ref Unsafe.As <Double, byte>(ref _data1[0]), VectorSize); Unsafe.CopyBlockUnaligned(ref Unsafe.As <Vector128 <Double>, byte>(ref _fld2), ref Unsafe.As <Double, byte>(ref _data2[0]), VectorSize); for (var i = 0; i < ElementCount; i++) { _data1[i] = (double)(random.NextDouble()); _data2[i] = (double)(random.NextDouble()); } _dataTable = new SimpleBinaryOpTest__DataTable <Double>(_data1, _data2, new Double[ElementCount], VectorSize); }
public SimpleBinaryOpTest__SubtractInt32() { Succeeded = true; var random = new Random(); for (var i = 0; i < ElementCount; i++) { _data1[i] = (int)(random.Next(int.MinValue, int.MaxValue)); _data2[i] = (int)(random.Next(int.MinValue, int.MaxValue)); } Unsafe.CopyBlockUnaligned(ref Unsafe.As <Vector128 <Int32>, byte>(ref _fld1), ref Unsafe.As <Int32, byte>(ref _data1[0]), VectorSize); Unsafe.CopyBlockUnaligned(ref Unsafe.As <Vector128 <Int32>, byte>(ref _fld2), ref Unsafe.As <Int32, byte>(ref _data2[0]), VectorSize); for (var i = 0; i < ElementCount; i++) { _data1[i] = (int)(random.Next(int.MinValue, int.MaxValue)); _data2[i] = (int)(random.Next(int.MinValue, int.MaxValue)); } _dataTable = new SimpleBinaryOpTest__DataTable <Int32>(_data1, _data2, new Int32[ElementCount], VectorSize); }