コード例 #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);
        }
コード例 #2
0
ファイル: Library.cs プロジェクト: kevmal/Spreads
		/// <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;
		}