Exemple #1
0
        /// <summary>Checks if the specified SIMD extension is supported by the processor.</summary>
        /// <param name="simdFeature">An object specifying the SIMD extension of interest.</param>
        /// <returns>true if processor supports the specified SIMD extension and false otherwise.</returns>
        /// <seealso cref="CpuSimdFeature" />
        /// <seealso cref="X86CpuSimdFeature" />
        /// <seealso cref="ArmCpuSimdFeature" />
        /// <seealso cref="MipsCpuSimdFeature" />
        /// <seealso cref="PowerPCCpuSimdFeature" />
        public static bool IsSupported(CpuSimdFeature simdFeature)
        {
            ulong  simdFeaturesMask = 0;
            Status status           = yepLibrary_GetCpuSimdFeatures(out simdFeaturesMask);

            if (status != Status.Ok)
            {
                throw GetException(status);
            }

            return((unchecked ((long)simdFeaturesMask) & (1L << unchecked ((int)simdFeature.Id))) != 0);
        }
Exemple #2
0
		/// <summary>Checks if the specified SIMD extension is supported by the processor.</summary>
		/// <param name="simdFeature">An object specifying the SIMD extension of interest.</param>
		/// <returns>true if processor supports the specified SIMD extension and false otherwise.</returns>
		/// <seealso cref="CpuSimdFeature" />
		/// <seealso cref="X86CpuSimdFeature" />
		/// <seealso cref="ArmCpuSimdFeature" />
		/// <seealso cref="MipsCpuSimdFeature" />
		public static bool IsSupported(CpuSimdFeature simdFeature)
		{
			ulong simdFeaturesMask = 0;
			Status status = yepLibrary_GetCpuSimdFeatures(out simdFeaturesMask);
			if (status != Status.Ok)
				throw GetException(status);

			return (unchecked((long)simdFeaturesMask) & (1L << unchecked((int)simdFeature.Id))) != 0;
		}