Exemple #1
0
def cpu(is_x86, is_64bit):
    cpu = CpuFeatures(name=platform.processor(),
                      vendor=platform.platform(),
                      arch=platform.machine(),
                      sse41=False,
                      sse42=False,
                      aes=False,
                      avx=False,
                      avx2=False)

    if is_x86:
        from cpuid import _is_set, cpu_vendor, cpu_name, cpu_microarchitecture

        cpu = CpuFeatures(
            name=cpu_name().rstrip('\x00'),
            vendor=cpu_vendor(),
            arch=cpu_microarchitecture()[0],
            sse41=_is_set(1, 2, 19) == 'Yes',
            sse42=_is_set(1, 2, 20) == 'Yes',
            aes=_is_set(1, 2, 25) == 'Yes',
            avx=_is_set(1, 2, 28) == 'Yes',
            avx2=_is_set(7, 1, 5) == 'Yes',
        )

    logging.getLogger().info("CPU %s", cpu)

    return cpu
def check_hardware():
    """
    checks the hardware
    """
    print("Checking Hardware:")
    print("  => Vendor ID         : %s" % cpu_vendor())
    print("  => CPU name          : %s" % cpu_name())
    print("  => Microarchitecture : %s%s" % cpu_microarchitecture())
    print("  => Vector instructions supported:")
    print("     -> SSE    : %s" % has_instruction(1, 3, 25))
    print("     -> SSE2   : %s" % has_instruction(1, 3, 26))
    print("     -> SSE3   : %s" % has_instruction(1, 2, 0))
    print("     -> SSSE3  : %s" % has_instruction(1, 2, 9))
    print("     -> SSE4.1 : %s" % has_instruction(1, 2, 19))
    print("     -> SSE4.2 : %s" % has_instruction(1, 2, 20))
    print("     -> SSE4a  : %s" % has_instruction(0x80000001, 2, 6))
    print("     -> AVX    : %s" % has_instruction(1, 2, 28))
    print("     -> AVX2   : %s" % has_instruction(7, 1, 5))
    print("     -> BMI1   : %s" % has_instruction(7, 1, 3))
    print("     -> BMI2   : %s" % has_instruction(7, 1, 8))
    print("\n")

    if has_instruction(1, 2, 28) != "Yes":
        print("  => ATTENTION: instruction set AVX is needed")
Exemple #3
0
def getCPUVendor():
    if not hasattr(getCPUVendor, 'vendor'):
        cpu = cpuid.CPUID()
        getCPUVendor.vendor = cpuid.cpu_vendor(cpu)
    return getCPUVendor.vendor
Exemple #4
0
P(speedup > 0) = {:.4f}

Vendor ID         : {:s}
CPU Name          : {:s}
Microarchitecture : {:s}

'''.format(
        str(df), str(df.describe()), args.loop, df_mean['nps_e1'],
        df_std['nps_e1'], df_mean['nps_e2'], df_std['nps_e2'],
        df_mean['nps_diff'], df_std['nps_diff'],
        df_mean['nps_diff'] / df_mean['nps_e1'],
        statsmodels.stats.weightstats.ttest_ind(df['nps_e1'].values,
                                                df['nps_e2'].values,
                                                alternative='larger',
                                                usevar='unequal')[1],
        cpuid.cpu_vendor(), cpuid.cpu_name(),
        '%s%s' % cpuid.cpu_microarchitecture()))
else:
    logger.info('''

{:s}

{:s}

Result of {:d} runs
==================
base           = {:10.0f} +/- {:.0f}

Vendor ID         : {:s}
CPU Name          : {:s}
Microarchitecture : {:s}