Beispiel #1
0
        private void ValidateResult(void *op1, void *op2, void *result, [CallerMemberName] string method = "")
        {
            UInt16[] inArray1 = new UInt16[Op1ElementCount];
            UInt16[] inArray2 = new UInt16[Op2ElementCount];
            UInt16[] outArray = new UInt16[RetElementCount];

            Unsafe.CopyBlockUnaligned(ref Unsafe.As <UInt16, byte>(ref inArray1[0]), ref Unsafe.AsRef <byte>(op1), (uint)Unsafe.SizeOf <Vector256 <UInt16> >());
            Unsafe.CopyBlockUnaligned(ref Unsafe.As <UInt16, byte>(ref inArray2[0]), ref Unsafe.AsRef <byte>(op2), (uint)Unsafe.SizeOf <Vector256 <UInt16> >());
            Unsafe.CopyBlockUnaligned(ref Unsafe.As <UInt16, byte>(ref outArray[0]), ref Unsafe.AsRef <byte>(result), (uint)Unsafe.SizeOf <Vector256 <UInt16> >());

            ValidateResult(inArray1, inArray2, outArray, method);
        }
Beispiel #2
0
        private void ValidateResult(Vector256<Single> op1, void* result, [CallerMemberName] string method = "")
        {
            Single[] inArray1 = new Single[Op1ElementCount];
            Single[] outArray = new Single[RetElementCount];

            Unsafe.WriteUnaligned(ref Unsafe.As<Single, byte>(ref inArray1[0]), op1);
            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Single, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector256<Single>>());

            ValidateResult(inArray1, outArray, method);
        }
        private void ValidateResult(void *firstOp, void *result, [CallerMemberName] string method = "")
        {
            Double[] inArray  = new Double[Op1ElementCount];
            Single[] outArray = new Single[RetElementCount];

            Unsafe.CopyBlockUnaligned(ref Unsafe.As <Double, byte>(ref inArray[0]), ref Unsafe.AsRef <byte>(firstOp), (uint)Unsafe.SizeOf <Vector128 <Double> >());
            Unsafe.CopyBlockUnaligned(ref Unsafe.As <Single, byte>(ref outArray[0]), ref Unsafe.AsRef <byte>(result), (uint)Unsafe.SizeOf <Vector128 <Single> >());

            ValidateResult(inArray, outArray, method);
        }
Beispiel #4
0
        private void ValidateResult(Vector256 <UInt32> left, Vector256 <UInt32> right, void *result, [CallerMemberName] string method = "")
        {
            UInt32[] inArray1 = new UInt32[Op1ElementCount];
            UInt32[] inArray2 = new UInt32[Op2ElementCount];
            UInt32[] outArray = new UInt32[RetElementCount];

            Unsafe.WriteUnaligned(ref Unsafe.As <UInt32, byte>(ref inArray1[0]), left);
            Unsafe.WriteUnaligned(ref Unsafe.As <UInt32, byte>(ref inArray2[0]), right);
            Unsafe.CopyBlockUnaligned(ref Unsafe.As <UInt32, byte>(ref outArray[0]), ref Unsafe.AsRef <byte>(result), (uint)Unsafe.SizeOf <Vector256 <UInt32> >());

            ValidateResult(inArray1, inArray2, outArray, method);
        }
        private void ValidateResult(Vector128 <UInt32> op1, void *result, [CallerMemberName] string method = "")
        {
            UInt32[] inArray1 = new UInt32[Op1ElementCount];
            UInt16[] outArray = new UInt16[RetElementCount];

            Unsafe.WriteUnaligned(ref Unsafe.As <UInt32, byte>(ref inArray1[0]), op1);
            Unsafe.CopyBlockUnaligned(ref Unsafe.As <UInt16, byte>(ref outArray[0]), ref Unsafe.AsRef <byte>(result), (uint)Unsafe.SizeOf <Vector64 <UInt16> >());

            ValidateResult(inArray1, outArray, method);
        }
Beispiel #6
0
        private void ValidateResult(void *firstOp, void *result, [CallerMemberName] string method = "")
        {
            Int32[] inArray  = new Int32[Op1ElementCount];
            Int16[] outArray = new Int16[RetElementCount];

            Unsafe.CopyBlockUnaligned(ref Unsafe.As <Int32, byte>(ref inArray[0]), ref Unsafe.AsRef <byte>(firstOp), (uint)Unsafe.SizeOf <Vector64 <Int32> >());
            Unsafe.CopyBlockUnaligned(ref Unsafe.As <Int16, byte>(ref outArray[0]), ref Unsafe.AsRef <byte>(result), (uint)Unsafe.SizeOf <Vector64 <Int16> >());

            ValidateResult(inArray, outArray, method);
        }
Beispiel #7
0
        private void ValidateResult(void *left, void *right, void *result, [CallerMemberName] string method = "")
        {
            Int64[] inArray1 = new Int64[Op1ElementCount];
            Int64[] inArray2 = new Int64[Op2ElementCount];
            Int64[] outArray = new Int64[RetElementCount];

            Unsafe.CopyBlockUnaligned(ref Unsafe.As <Int64, byte>(ref inArray1[0]), ref Unsafe.AsRef <byte>(left), VectorSize);
            Unsafe.CopyBlockUnaligned(ref Unsafe.As <Int64, byte>(ref inArray2[0]), ref Unsafe.AsRef <byte>(right), VectorSize);
            Unsafe.CopyBlockUnaligned(ref Unsafe.As <Int64, byte>(ref outArray[0]), ref Unsafe.AsRef <byte>(result), VectorSize);

            ValidateResult(inArray1, inArray2, outArray, method);
        }
Beispiel #8
0
        private void ValidateResult(void *left, void *right, void *result, [CallerMemberName] string method = "")
        {
            Single[] inArray1 = new Single[Op1ElementCount];
            Single[] inArray2 = new Single[Op2ElementCount];
            Single[] outArray = new Single[RetElementCount];

            Unsafe.CopyBlockUnaligned(ref Unsafe.As <Single, byte>(ref inArray1[0]), ref Unsafe.AsRef <byte>(left), (uint)Unsafe.SizeOf <Vector128 <Single> >());
            Unsafe.CopyBlockUnaligned(ref Unsafe.As <Single, byte>(ref inArray2[0]), ref Unsafe.AsRef <byte>(right), (uint)Unsafe.SizeOf <Vector128 <Single> >());
            Unsafe.CopyBlockUnaligned(ref Unsafe.As <Single, byte>(ref outArray[0]), ref Unsafe.AsRef <byte>(result), (uint)Unsafe.SizeOf <Vector128 <Single> >());

            ValidateResult(inArray1, inArray2, outArray, method);
        }
Beispiel #9
0
        private void ValidateResult(void *op1, void *op2, void *result, [CallerMemberName] string method = "")
        {
            Int64[] inArray1 = new Int64[Op1ElementCount];
            Int64[] inArray2 = new Int64[Op2ElementCount];
            Int32[] outArray = new Int32[RetElementCount];

            Unsafe.CopyBlockUnaligned(ref Unsafe.As <Int64, byte>(ref inArray1[0]), ref Unsafe.AsRef <byte>(op1), (uint)Unsafe.SizeOf <Vector128 <Int64> >());
            Unsafe.CopyBlockUnaligned(ref Unsafe.As <Int64, byte>(ref inArray2[0]), ref Unsafe.AsRef <byte>(op2), (uint)Unsafe.SizeOf <Vector128 <Int64> >());
            Unsafe.CopyBlockUnaligned(ref Unsafe.As <Int32, byte>(ref outArray[0]), ref Unsafe.AsRef <byte>(result), (uint)Unsafe.SizeOf <Vector64 <Int32> >());

            ValidateResult(inArray1, inArray2, outArray, method);
        }
        private void ValidateResult(Vector64 <Int16> op1, Vector64 <Int16> op2, Vector128 <Int16> op3, void *result, [CallerMemberName] string method = "")
        {
            Int16[] inArray1 = new Int16[Op1ElementCount];
            Int16[] inArray2 = new Int16[Op2ElementCount];
            Int16[] inArray3 = new Int16[Op3ElementCount];
            Int16[] outArray = new Int16[RetElementCount];

            Unsafe.WriteUnaligned(ref Unsafe.As <Int16, byte>(ref inArray1[0]), op1);
            Unsafe.WriteUnaligned(ref Unsafe.As <Int16, byte>(ref inArray2[0]), op2);
            Unsafe.WriteUnaligned(ref Unsafe.As <Int16, byte>(ref inArray3[0]), op3);
            Unsafe.CopyBlockUnaligned(ref Unsafe.As <Int16, byte>(ref outArray[0]), ref Unsafe.AsRef <byte>(result), (uint)Unsafe.SizeOf <Vector64 <Int16> >());

            ValidateResult(inArray1, inArray2, inArray3, outArray, method);
        }
Beispiel #11
0
        private void ValidateResult(void *left, void *right, bool result, [CallerMemberName] string method = "")
        {
            SByte[] inArray1 = new SByte[Op1ElementCount];
            SByte[] inArray2 = new SByte[Op2ElementCount];

            Unsafe.CopyBlockUnaligned(ref Unsafe.As <SByte, byte>(ref inArray1[0]), ref Unsafe.AsRef <byte>(left), VectorSize);
            Unsafe.CopyBlockUnaligned(ref Unsafe.As <SByte, byte>(ref inArray2[0]), ref Unsafe.AsRef <byte>(right), VectorSize);

            ValidateResult(inArray1, inArray2, result, method);
        }
Beispiel #12
0
        private void ValidateResult(void *firstOp, void *secondOp, void *thirdOp, void *result, [CallerMemberName] string method = "")
        {
            Double[] inArray1 = new Double[Op1ElementCount];
            Double[] inArray2 = new Double[Op2ElementCount];
            Double[] inArray3 = new Double[Op3ElementCount];
            Double[] outArray = new Double[RetElementCount];

            Unsafe.CopyBlockUnaligned(ref Unsafe.As <Double, byte>(ref inArray1[0]), ref Unsafe.AsRef <byte>(firstOp), (uint)Unsafe.SizeOf <Vector256 <Double> >());
            Unsafe.CopyBlockUnaligned(ref Unsafe.As <Double, byte>(ref inArray2[0]), ref Unsafe.AsRef <byte>(secondOp), (uint)Unsafe.SizeOf <Vector256 <Double> >());
            Unsafe.CopyBlockUnaligned(ref Unsafe.As <Double, byte>(ref inArray3[0]), ref Unsafe.AsRef <byte>(thirdOp), (uint)Unsafe.SizeOf <Vector256 <Double> >());
            Unsafe.CopyBlockUnaligned(ref Unsafe.As <Double, byte>(ref outArray[0]), ref Unsafe.AsRef <byte>(result), (uint)Unsafe.SizeOf <Vector256 <Double> >());

            ValidateResult(inArray1, inArray2, inArray3, outArray, method);
        }