public BooleanBinaryOpTest__TestCByte() { Succeeded = true; for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } 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] = TestLibrary.Generator.GetByte(); } Unsafe.CopyBlockUnaligned(ref Unsafe.As <Vector128 <Byte>, byte>(ref _fld2), ref Unsafe.As <Byte, byte>(ref _data2[0]), (uint)Unsafe.SizeOf <Vector128 <Byte> >()); for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } _dataTable = new BooleanBinaryOpTest__DataTable <Byte, Byte>(_data1, _data2, LargestVectorSize); }
public BooleanBinaryOpTest__TestZUInt16() { 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 <Vector256 <UInt16>, byte>(ref _fld1), ref Unsafe.As <UInt16, byte>(ref _data1[0]), (uint)Unsafe.SizeOf <Vector256 <UInt16> >()); for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = (ushort)(random.Next(0, ushort.MaxValue)); } Unsafe.CopyBlockUnaligned(ref Unsafe.As <Vector256 <UInt16>, byte>(ref _fld2), ref Unsafe.As <UInt16, byte>(ref _data2[0]), (uint)Unsafe.SizeOf <Vector256 <UInt16> >()); 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 BooleanBinaryOpTest__DataTable <UInt16, UInt16>(_data1, _data2, LargestVectorSize); }
public BooleanBinaryOpTest__TestZByte() { 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 BooleanBinaryOpTest__DataTable <Byte, Byte>(_data1, _data2, VectorSize); }
public BooleanBinaryOpTest__TestCInt16() { Succeeded = true; var random = new Random(); for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = (short)(random.Next(short.MinValue, short.MaxValue)); } Unsafe.CopyBlockUnaligned(ref Unsafe.As <Vector128 <Int16>, byte>(ref _fld1), ref Unsafe.As <Int16, byte>(ref _data1[0]), VectorSize); for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = (short)(random.Next(short.MinValue, short.MaxValue)); } Unsafe.CopyBlockUnaligned(ref Unsafe.As <Vector128 <Int16>, byte>(ref _fld2), ref Unsafe.As <Int16, byte>(ref _data2[0]), VectorSize); for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = (short)(random.Next(short.MinValue, short.MaxValue)); } for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = (short)(random.Next(short.MinValue, short.MaxValue)); } _dataTable = new BooleanBinaryOpTest__DataTable <Int16, Int16>(_data1, _data2, VectorSize); }
public BooleanBinaryOpTest__TestZInt64() { 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 <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] = (long)(random.Next(int.MinValue, int.MaxValue)); } Unsafe.CopyBlockUnaligned(ref Unsafe.As <Vector256 <Int64>, byte>(ref _fld2), ref Unsafe.As <Int64, byte>(ref _data2[0]), (uint)Unsafe.SizeOf <Vector256 <Int64> >()); 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 BooleanBinaryOpTest__DataTable <Int64, Int64>(_data1, _data2, LargestVectorSize); }
public BooleanBinaryOpTest__TestCSByte() { 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 <Vector128 <SByte>, byte>(ref _fld1), ref Unsafe.As <SByte, byte>(ref _data1[0]), (uint)Unsafe.SizeOf <Vector128 <SByte> >()); 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] = (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 BooleanBinaryOpTest__DataTable <SByte, SByte>(_data1, _data2, LargestVectorSize); }
public BooleanBinaryOpTest__TestCUInt64() { 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 <Vector256 <UInt64>, byte>(ref _fld1), ref Unsafe.As <UInt64, byte>(ref _data1[0]), VectorSize); for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = (ulong)(random.Next(0, int.MaxValue)); } Unsafe.CopyBlockUnaligned(ref Unsafe.As <Vector256 <UInt64>, byte>(ref _fld2), ref Unsafe.As <UInt64, byte>(ref _data2[0]), VectorSize); 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 BooleanBinaryOpTest__DataTable <UInt64, UInt64>(_data1, _data2, VectorSize); }