File: index.rst

package info (click to toggle)
python-os-traits 3.5.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 400 kB
  • sloc: python: 752; makefile: 21; sh: 2
file content (59 lines) | stat: -rw-r--r-- 1,532 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
=====
Usage
=====

`os-traits` is primarily composed of a set of constants that may be referenced
by simply importing the ``os_traits`` module and referencing one of the
module's traits constants::

    $ python3
    Python 3.6.8 (default, Oct  7 2019, 12:59:55)
    [GCC 8.3.0] on linux
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import os_traits as ot
    >>> print(ot.HW_CPU_X86_SSE42)
    HW_CPU_X86_SSE42

You can get a list of the ``os_traits`` symbols by simply doing a
``dir(os_traits)``.

Want to see the trait strings for a subset of traits? There's a method for that
too::

    >>> import pprint
    >>> pprint.pprint(ot.get_traits(prefix='HW_CPU_X86_'))
    ['HW_CPU_X86_FMA3',
    'HW_CPU_X86_AVX',
    'HW_CPU_X86_MMX',
    'HW_CPU_X86_MPX',
    'HW_CPU_X86_CLMUL',
    'HW_CPU_X86_AVX512VL',
    'HW_CPU_X86_AVX512CD',
    'HW_CPU_X86_BMI',
    'HW_CPU_X86_AVX512DQ',
    'HW_CPU_X86_SSE3',
    'HW_CPU_X86_ABM',
    'HW_CPU_X86_SSE4A',
    'HW_CPU_X86_AESNI',
    'HW_CPU_X86_F16C',
    'HW_CPU_X86_VMX',
    'HW_CPU_X86_SVM',
    'HW_CPU_X86_TSX',
    'HW_CPU_X86_AVX512PF',
    'HW_CPU_X86_SSE41',
    'HW_CPU_X86_ASF',
    'HW_CPU_X86_SGX',
    'HW_CPU_X86_SSE',
    'HW_CPU_X86_SSSE3',
    'HW_CPU_X86_SHA',
    'HW_CPU_X86_TBM',
    'HW_CPU_X86_SSE42',
    'HW_CPU_X86_3DNOW',
    'HW_CPU_X86_BMI2',
    'HW_CPU_X86_AVX512BW',
    'HW_CPU_X86_XOP',
    'HW_CPU_X86_AVX2',
    'HW_CPU_X86_AVX512F',
    'HW_CPU_X86_SSE2',
    'HW_CPU_X86_FMA4',
    'HW_CPU_X86_AVX512ER']