// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. // using System; using System.Numerics; internal partial class VectorTest { private const int Pass = 100; private const int Fail = -1; private class VectorHWAccelTest where T : struct, IComparable, IEquatable { public static int VectorHWAccel(T a, T b, T c) { if (Vector.IsHardwareAccelerated) { Vector A = new Vector(a); Vector B = new Vector(b); Vector C = A + B; for (int i = 0; i < Vector.Count; i++) { if (!(CheckValue(C[i], c))) { return Fail; } } return Pass; } else { return Pass; } } } private static int Main() { int returnVal = Pass; if (VectorHWAccelTest.VectorHWAccel(1, 2, (float)(1 + 2)) != Pass) returnVal = Fail; return returnVal; } }