roaringbitmap 0.7.3__tar.gz → 0.7.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: roaringbitmap
3
- Version: 0.7.3
3
+ Version: 0.7.4
4
4
  Summary: Roaring Bitmap
5
5
  Home-page: http://roaringbitmap.readthedocs.io
6
6
  Author: Andreas van Cranenburgh
@@ -66,9 +66,18 @@ The code is licensed under GNU GPL v2, or any later version at your option.
66
66
  - Python 2.7+/3.3+ http://www.python.org (headers required, e.g. python-dev package)
67
67
  - Cython 3.0+ http://www.cython.org
68
68
 
69
- Installation, usage
70
- -------------------
69
+ Installation
70
+ ------------
71
71
 
72
+ ::
73
+ $ pip install roaringbitmap
74
+
75
+ For Linux and Mac, there are binary wheels. Binary wheels for x86-64 require
76
+ the POPCNT CPU instruction and raise ``ImportError`` on unsupported CPUs.
77
+ Builds from source use ``-march=native`` by default and are optimized for the
78
+ build machine.
79
+
80
+ To compile from source:
72
81
  ::
73
82
 
74
83
  $ git clone https://github.com/andreasvc/roaringbitmap.git
@@ -83,6 +92,10 @@ For Python 2, build with a Cython version that supports Python 2.7::
83
92
  The C sources published on PyPI are generated with the current Cython release
84
93
  and support Python 3 only.
85
94
 
95
+
96
+ Usage
97
+ -----
98
+
86
99
  A ``RoaringBitmap()`` can be used as a replacement for a normal (mutable)
87
100
  Python set containing (unsigned) 32-bit integers:
88
101
 
@@ -115,54 +128,63 @@ Output of ``$ make bench``::
115
128
 
116
129
  small sparse set
117
130
  100 runs with sets of 200 random elements n s.t. 0 <= n < 40000
118
- set() RoaringBitmap() ratio
119
- init 0.000834 0.00138 0.603
120
- initsort 0.00085 0.000394 2.16
121
- and 0.00102 8.49e-05 12.1
122
- or 0.00171 0.000169 10.1
123
- xor 0.00152 0.000213 7.11
124
- sub 0.000934 0.000197 4.74
125
- iand 1.29e-05 2.97e-06 4.35
126
- ior 9.7e-06 3.26e-06 2.98
127
- ixor 8.98e-06 3.43e-06 2.62
128
- isub 6.83e-06 3.3e-06 2.07
129
- eq 0.000438 1.17e-05 37.6
130
- neq 6.37e-06 7.81e-06 0.816
131
- jaccard 0.0029 0.000126 23.1
131
+ set() RoaringBitmap() ratio
132
+ init 0.000383 0.000627 0.61
133
+ initsort 0.000992 0.000258 3.85
134
+ and 0.000499 0.000125 3.98
135
+ or 0.000507 8.9e-05 5.7
136
+ xor 0.000479 8.14e-05 5.88
137
+ sub 0.000335 7.57e-05 4.42
138
+ iand 1.18e-05 2.77e-06 4.26
139
+ ior 8.39e-06 2.75e-06 3.05
140
+ ixor 8.12e-06 2.81e-06 2.89
141
+ isub 6.54e-06 2.87e-06 2.28
142
+ eq_identity 0.000183 4.78e-06 38.2
143
+ eq_equal 0.000169 7.33e-06 23
144
+ neq_card 4.62e-06 5.43e-06 0.85
145
+ neq_early 1.79e-05 6.21e-06 2.89
146
+ neq_late 0.000167 6.64e-06 25.2
147
+ jaccard 0.000973 4.99e-05 19.5
132
148
 
133
149
  medium load factor
134
150
  100 runs with sets of 59392 random elements n s.t. 0 <= n < 118784
135
- set() RoaringBitmap() ratio
136
- init 0.564 0.324 1.74
137
- initsort 0.696 0.273 2.55
138
- and 0.613 0.000418 1466
139
- or 0.976 0.000292 3344
140
- xor 0.955 0.000294 3250
141
- sub 0.346 0.000316 1092
142
- iand 0.00658 1.14e-05 575
143
- ior 0.00594 1.08e-05 548
144
- ixor 0.00434 1.12e-05 385
145
- isub 0.00431 1.09e-05 397
146
- eq 0.0991 0.000116 851
147
- neq 9.62e-06 1.29e-05 0.743
148
- jaccard 1.62 0.00025 6476
151
+ set() RoaringBitmap() ratio
152
+ init 0.451 0.138 3.26
153
+ initsort 0.349 0.0995 3.51
154
+ and 0.362 0.000271 1336
155
+ or 0.482 0.000248 1942
156
+ xor 0.46 0.000258 1780
157
+ sub 0.381 0.000444 857
158
+ iand 0.00421 5.33e-06 790
159
+ ior 0.00581 5.49e-06 1058
160
+ ixor 0.00243 5.05e-06 481
161
+ isub 0.00229 4.88e-06 469
162
+ eq_identity 0.123 1.64e-05 7501
163
+ eq_equal 0.137 3.75e-05 3643
164
+ neq_card 7.49e-06 7.06e-06 1.06
165
+ neq_early 8.08e-06 2.22e-05 0.364
166
+ neq_late 0.139 5.42e-05 2571
167
+ jaccard 0.88 0.000183 4806
149
168
 
150
169
  dense set / high load factor
151
170
  100 runs with sets of 39800 random elements n s.t. 0 <= n < 40000
152
- set() RoaringBitmap() ratio
153
- init 0.33 0.0775 4.26
154
- initsort 0.352 0.148 2.38
155
- and 0.24 0.000223 1078
156
- or 0.45 0.000165 2734
157
- xor 0.404 0.000161 2514
158
- sub 0.169 0.000173 973
159
- iand 0.00287 6.02e-06 477
160
- ior 0.00179 6.34e-06 282
161
- ixor 0.00195 5.53e-06 353
162
- isub 0.0017 6.35e-06 267
163
- eq 0.0486 4.65e-05 1045
164
- neq 1.01e-05 1.13e-05 0.888
165
- jaccard 0.722 0.000118 6136
171
+ set() RoaringBitmap() ratio
172
+ init 0.206 0.0967 2.13
173
+ initsort 0.179 0.0531 3.37
174
+ and 0.149 0.000134 1117
175
+ or 0.209 0.000112 1862
176
+ xor 0.186 0.000112 1653
177
+ sub 0.12 0.000109 1092
178
+ iand 0.00174 3.75e-06 463
179
+ ior 0.000865 3.58e-06 241
180
+ ixor 0.00112 3.6e-06 310
181
+ isub 0.00102 3.5e-06 292
182
+ eq_identity 0.052 5.39e-06 9644
183
+ eq_equal 0.0559 1.68e-05 3318
184
+ neq_card 7.18e-06 7.53e-06 0.954
185
+ neq_early 7.17e-06 7.73e-06 0.928
186
+ neq_late 0.0437 1.36e-05 3209
187
+ jaccard 0.342 9.84e-05 3472
166
188
 
167
189
  See https://github.com/Ezibenroc/roaring_analysis/ for a performance comparison
168
190
  of PyRoaringBitmap and this library.
@@ -38,9 +38,18 @@ The code is licensed under GNU GPL v2, or any later version at your option.
38
38
  - Python 2.7+/3.3+ http://www.python.org (headers required, e.g. python-dev package)
39
39
  - Cython 3.0+ http://www.cython.org
40
40
 
41
- Installation, usage
42
- -------------------
41
+ Installation
42
+ ------------
43
43
 
44
+ ::
45
+ $ pip install roaringbitmap
46
+
47
+ For Linux and Mac, there are binary wheels. Binary wheels for x86-64 require
48
+ the POPCNT CPU instruction and raise ``ImportError`` on unsupported CPUs.
49
+ Builds from source use ``-march=native`` by default and are optimized for the
50
+ build machine.
51
+
52
+ To compile from source:
44
53
  ::
45
54
 
46
55
  $ git clone https://github.com/andreasvc/roaringbitmap.git
@@ -55,6 +64,10 @@ For Python 2, build with a Cython version that supports Python 2.7::
55
64
  The C sources published on PyPI are generated with the current Cython release
56
65
  and support Python 3 only.
57
66
 
67
+
68
+ Usage
69
+ -----
70
+
58
71
  A ``RoaringBitmap()`` can be used as a replacement for a normal (mutable)
59
72
  Python set containing (unsigned) 32-bit integers:
60
73
 
@@ -87,54 +100,63 @@ Output of ``$ make bench``::
87
100
 
88
101
  small sparse set
89
102
  100 runs with sets of 200 random elements n s.t. 0 <= n < 40000
90
- set() RoaringBitmap() ratio
91
- init 0.000834 0.00138 0.603
92
- initsort 0.00085 0.000394 2.16
93
- and 0.00102 8.49e-05 12.1
94
- or 0.00171 0.000169 10.1
95
- xor 0.00152 0.000213 7.11
96
- sub 0.000934 0.000197 4.74
97
- iand 1.29e-05 2.97e-06 4.35
98
- ior 9.7e-06 3.26e-06 2.98
99
- ixor 8.98e-06 3.43e-06 2.62
100
- isub 6.83e-06 3.3e-06 2.07
101
- eq 0.000438 1.17e-05 37.6
102
- neq 6.37e-06 7.81e-06 0.816
103
- jaccard 0.0029 0.000126 23.1
103
+ set() RoaringBitmap() ratio
104
+ init 0.000383 0.000627 0.61
105
+ initsort 0.000992 0.000258 3.85
106
+ and 0.000499 0.000125 3.98
107
+ or 0.000507 8.9e-05 5.7
108
+ xor 0.000479 8.14e-05 5.88
109
+ sub 0.000335 7.57e-05 4.42
110
+ iand 1.18e-05 2.77e-06 4.26
111
+ ior 8.39e-06 2.75e-06 3.05
112
+ ixor 8.12e-06 2.81e-06 2.89
113
+ isub 6.54e-06 2.87e-06 2.28
114
+ eq_identity 0.000183 4.78e-06 38.2
115
+ eq_equal 0.000169 7.33e-06 23
116
+ neq_card 4.62e-06 5.43e-06 0.85
117
+ neq_early 1.79e-05 6.21e-06 2.89
118
+ neq_late 0.000167 6.64e-06 25.2
119
+ jaccard 0.000973 4.99e-05 19.5
104
120
 
105
121
  medium load factor
106
122
  100 runs with sets of 59392 random elements n s.t. 0 <= n < 118784
107
- set() RoaringBitmap() ratio
108
- init 0.564 0.324 1.74
109
- initsort 0.696 0.273 2.55
110
- and 0.613 0.000418 1466
111
- or 0.976 0.000292 3344
112
- xor 0.955 0.000294 3250
113
- sub 0.346 0.000316 1092
114
- iand 0.00658 1.14e-05 575
115
- ior 0.00594 1.08e-05 548
116
- ixor 0.00434 1.12e-05 385
117
- isub 0.00431 1.09e-05 397
118
- eq 0.0991 0.000116 851
119
- neq 9.62e-06 1.29e-05 0.743
120
- jaccard 1.62 0.00025 6476
123
+ set() RoaringBitmap() ratio
124
+ init 0.451 0.138 3.26
125
+ initsort 0.349 0.0995 3.51
126
+ and 0.362 0.000271 1336
127
+ or 0.482 0.000248 1942
128
+ xor 0.46 0.000258 1780
129
+ sub 0.381 0.000444 857
130
+ iand 0.00421 5.33e-06 790
131
+ ior 0.00581 5.49e-06 1058
132
+ ixor 0.00243 5.05e-06 481
133
+ isub 0.00229 4.88e-06 469
134
+ eq_identity 0.123 1.64e-05 7501
135
+ eq_equal 0.137 3.75e-05 3643
136
+ neq_card 7.49e-06 7.06e-06 1.06
137
+ neq_early 8.08e-06 2.22e-05 0.364
138
+ neq_late 0.139 5.42e-05 2571
139
+ jaccard 0.88 0.000183 4806
121
140
 
122
141
  dense set / high load factor
123
142
  100 runs with sets of 39800 random elements n s.t. 0 <= n < 40000
124
- set() RoaringBitmap() ratio
125
- init 0.33 0.0775 4.26
126
- initsort 0.352 0.148 2.38
127
- and 0.24 0.000223 1078
128
- or 0.45 0.000165 2734
129
- xor 0.404 0.000161 2514
130
- sub 0.169 0.000173 973
131
- iand 0.00287 6.02e-06 477
132
- ior 0.00179 6.34e-06 282
133
- ixor 0.00195 5.53e-06 353
134
- isub 0.0017 6.35e-06 267
135
- eq 0.0486 4.65e-05 1045
136
- neq 1.01e-05 1.13e-05 0.888
137
- jaccard 0.722 0.000118 6136
143
+ set() RoaringBitmap() ratio
144
+ init 0.206 0.0967 2.13
145
+ initsort 0.179 0.0531 3.37
146
+ and 0.149 0.000134 1117
147
+ or 0.209 0.000112 1862
148
+ xor 0.186 0.000112 1653
149
+ sub 0.12 0.000109 1092
150
+ iand 0.00174 3.75e-06 463
151
+ ior 0.000865 3.58e-06 241
152
+ ixor 0.00112 3.6e-06 310
153
+ isub 0.00102 3.5e-06 292
154
+ eq_identity 0.052 5.39e-06 9644
155
+ eq_equal 0.0559 1.68e-05 3318
156
+ neq_card 7.18e-06 7.53e-06 0.954
157
+ neq_early 7.17e-06 7.73e-06 0.928
158
+ neq_late 0.0437 1.36e-05 3209
159
+ jaccard 0.342 9.84e-05 3472
138
160
 
139
161
  See https://github.com/Ezibenroc/roaring_analysis/ for a performance comparison
140
162
  of PyRoaringBitmap and this library.
@@ -12,3 +12,11 @@ dev = [
12
12
  "pytest>=3.0.0",
13
13
  "pycodestyle",
14
14
  ]
15
+
16
+ [tool.cibuildwheel]
17
+ build = "cp311-* cp312-* cp313-* cp314-* cp315-*"
18
+ skip = "*-musllinux_*"
19
+ build-verbosity = 1
20
+ environment = { ROARINGBITMAP_BUILD_WHEEL = "1" }
21
+ test-requires = "pytest"
22
+ test-command = "python -m pytest {project}/tests/unittests.py"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: roaringbitmap
3
- Version: 0.7.3
3
+ Version: 0.7.4
4
4
  Summary: Roaring Bitmap
5
5
  Home-page: http://roaringbitmap.readthedocs.io
6
6
  Author: Andreas van Cranenburgh
@@ -66,9 +66,18 @@ The code is licensed under GNU GPL v2, or any later version at your option.
66
66
  - Python 2.7+/3.3+ http://www.python.org (headers required, e.g. python-dev package)
67
67
  - Cython 3.0+ http://www.cython.org
68
68
 
69
- Installation, usage
70
- -------------------
69
+ Installation
70
+ ------------
71
71
 
72
+ ::
73
+ $ pip install roaringbitmap
74
+
75
+ For Linux and Mac, there are binary wheels. Binary wheels for x86-64 require
76
+ the POPCNT CPU instruction and raise ``ImportError`` on unsupported CPUs.
77
+ Builds from source use ``-march=native`` by default and are optimized for the
78
+ build machine.
79
+
80
+ To compile from source:
72
81
  ::
73
82
 
74
83
  $ git clone https://github.com/andreasvc/roaringbitmap.git
@@ -83,6 +92,10 @@ For Python 2, build with a Cython version that supports Python 2.7::
83
92
  The C sources published on PyPI are generated with the current Cython release
84
93
  and support Python 3 only.
85
94
 
95
+
96
+ Usage
97
+ -----
98
+
86
99
  A ``RoaringBitmap()`` can be used as a replacement for a normal (mutable)
87
100
  Python set containing (unsigned) 32-bit integers:
88
101
 
@@ -115,54 +128,63 @@ Output of ``$ make bench``::
115
128
 
116
129
  small sparse set
117
130
  100 runs with sets of 200 random elements n s.t. 0 <= n < 40000
118
- set() RoaringBitmap() ratio
119
- init 0.000834 0.00138 0.603
120
- initsort 0.00085 0.000394 2.16
121
- and 0.00102 8.49e-05 12.1
122
- or 0.00171 0.000169 10.1
123
- xor 0.00152 0.000213 7.11
124
- sub 0.000934 0.000197 4.74
125
- iand 1.29e-05 2.97e-06 4.35
126
- ior 9.7e-06 3.26e-06 2.98
127
- ixor 8.98e-06 3.43e-06 2.62
128
- isub 6.83e-06 3.3e-06 2.07
129
- eq 0.000438 1.17e-05 37.6
130
- neq 6.37e-06 7.81e-06 0.816
131
- jaccard 0.0029 0.000126 23.1
131
+ set() RoaringBitmap() ratio
132
+ init 0.000383 0.000627 0.61
133
+ initsort 0.000992 0.000258 3.85
134
+ and 0.000499 0.000125 3.98
135
+ or 0.000507 8.9e-05 5.7
136
+ xor 0.000479 8.14e-05 5.88
137
+ sub 0.000335 7.57e-05 4.42
138
+ iand 1.18e-05 2.77e-06 4.26
139
+ ior 8.39e-06 2.75e-06 3.05
140
+ ixor 8.12e-06 2.81e-06 2.89
141
+ isub 6.54e-06 2.87e-06 2.28
142
+ eq_identity 0.000183 4.78e-06 38.2
143
+ eq_equal 0.000169 7.33e-06 23
144
+ neq_card 4.62e-06 5.43e-06 0.85
145
+ neq_early 1.79e-05 6.21e-06 2.89
146
+ neq_late 0.000167 6.64e-06 25.2
147
+ jaccard 0.000973 4.99e-05 19.5
132
148
 
133
149
  medium load factor
134
150
  100 runs with sets of 59392 random elements n s.t. 0 <= n < 118784
135
- set() RoaringBitmap() ratio
136
- init 0.564 0.324 1.74
137
- initsort 0.696 0.273 2.55
138
- and 0.613 0.000418 1466
139
- or 0.976 0.000292 3344
140
- xor 0.955 0.000294 3250
141
- sub 0.346 0.000316 1092
142
- iand 0.00658 1.14e-05 575
143
- ior 0.00594 1.08e-05 548
144
- ixor 0.00434 1.12e-05 385
145
- isub 0.00431 1.09e-05 397
146
- eq 0.0991 0.000116 851
147
- neq 9.62e-06 1.29e-05 0.743
148
- jaccard 1.62 0.00025 6476
151
+ set() RoaringBitmap() ratio
152
+ init 0.451 0.138 3.26
153
+ initsort 0.349 0.0995 3.51
154
+ and 0.362 0.000271 1336
155
+ or 0.482 0.000248 1942
156
+ xor 0.46 0.000258 1780
157
+ sub 0.381 0.000444 857
158
+ iand 0.00421 5.33e-06 790
159
+ ior 0.00581 5.49e-06 1058
160
+ ixor 0.00243 5.05e-06 481
161
+ isub 0.00229 4.88e-06 469
162
+ eq_identity 0.123 1.64e-05 7501
163
+ eq_equal 0.137 3.75e-05 3643
164
+ neq_card 7.49e-06 7.06e-06 1.06
165
+ neq_early 8.08e-06 2.22e-05 0.364
166
+ neq_late 0.139 5.42e-05 2571
167
+ jaccard 0.88 0.000183 4806
149
168
 
150
169
  dense set / high load factor
151
170
  100 runs with sets of 39800 random elements n s.t. 0 <= n < 40000
152
- set() RoaringBitmap() ratio
153
- init 0.33 0.0775 4.26
154
- initsort 0.352 0.148 2.38
155
- and 0.24 0.000223 1078
156
- or 0.45 0.000165 2734
157
- xor 0.404 0.000161 2514
158
- sub 0.169 0.000173 973
159
- iand 0.00287 6.02e-06 477
160
- ior 0.00179 6.34e-06 282
161
- ixor 0.00195 5.53e-06 353
162
- isub 0.0017 6.35e-06 267
163
- eq 0.0486 4.65e-05 1045
164
- neq 1.01e-05 1.13e-05 0.888
165
- jaccard 0.722 0.000118 6136
171
+ set() RoaringBitmap() ratio
172
+ init 0.206 0.0967 2.13
173
+ initsort 0.179 0.0531 3.37
174
+ and 0.149 0.000134 1117
175
+ or 0.209 0.000112 1862
176
+ xor 0.186 0.000112 1653
177
+ sub 0.12 0.000109 1092
178
+ iand 0.00174 3.75e-06 463
179
+ ior 0.000865 3.58e-06 241
180
+ ixor 0.00112 3.6e-06 310
181
+ isub 0.00102 3.5e-06 292
182
+ eq_identity 0.052 5.39e-06 9644
183
+ eq_equal 0.0559 1.68e-05 3318
184
+ neq_card 7.18e-06 7.53e-06 0.954
185
+ neq_early 7.17e-06 7.73e-06 0.928
186
+ neq_late 0.0437 1.36e-05 3209
187
+ jaccard 0.342 9.84e-05 3472
166
188
 
167
189
  See https://github.com/Ezibenroc/roaring_analysis/ for a performance comparison
168
190
  of PyRoaringBitmap and this library.
@@ -9,5 +9,6 @@ roaringbitmap.egg-info/dependency_links.txt
9
9
  roaringbitmap.egg-info/top_level.txt
10
10
  src/_arrayops.h
11
11
  src/bitcount.h
12
+ src/cpu_features.h
12
13
  src/macros.h
13
14
  src/roaringbitmap.c
@@ -1,5 +1,6 @@
1
1
  """Generic setup.py for Cython code."""
2
2
  import os
3
+ import platform
3
4
  import sys
4
5
  from setuptools import Extension, setup
5
6
 
@@ -28,11 +29,16 @@ MTUNE = '--with-mtune' in sys.argv
28
29
  if MTUNE:
29
30
  sys.argv.remove('--with-mtune')
30
31
 
32
+ # Release wheels must not inherit all instruction sets from the CI host. The
33
+ # x86-64 wheels deliberately require POPCNT, which provides most of the
34
+ # performance benefit of -march=native while remaining a predictable target.
35
+ WHEEL_BUILD = os.environ.get('ROARINGBITMAP_BUILD_WHEEL') == '1'
36
+
31
37
  with open('README.rst') as inp:
32
38
  README = inp.read()
33
39
 
34
40
  METADATA = dict(name='roaringbitmap',
35
- version='0.7.3',
41
+ version='0.7.4',
36
42
  description='Roaring Bitmap',
37
43
  long_description=README,
38
44
  long_description_content_type='text/x-rst',
@@ -85,7 +91,13 @@ if __name__ == '__main__':
85
91
  extra_link_args = []
86
92
  if not DEBUG and sys.platform != 'win32':
87
93
  extra_compile_args += ['-O3', '-DNDEBUG']
88
- extra_compile_args += ['-mtune=native'] if MTUNE else ['-march=native']
94
+ if WHEEL_BUILD:
95
+ if platform.machine().lower() in ('amd64', 'x86_64'):
96
+ extra_compile_args += [
97
+ '-DROARINGBITMAP_REQUIRE_POPCNT=1', '-mpopcnt']
98
+ else:
99
+ extra_compile_args += (
100
+ ['-mtune=native'] if MTUNE else ['-march=native'])
89
101
  extra_link_args += ['-DNDEBUG']
90
102
  if USE_CYTHON:
91
103
  if DEBUG:
@@ -0,0 +1,30 @@
1
+ #ifndef ROARINGBITMAP_CPU_FEATURES_H_
2
+ #define ROARINGBITMAP_CPU_FEATURES_H_
3
+
4
+ #if defined(ROARINGBITMAP_REQUIRE_POPCNT) && defined(_MSC_VER)
5
+ #include <intrin.h>
6
+ #endif
7
+
8
+ /* Release wheels define this when they are compiled with -mpopcnt. Source
9
+ * builds and non-x86 wheels do not require features beyond their target's
10
+ * normal architecture baseline. */
11
+ static int roaring_cpu_supports_required_features(void) {
12
+ #if defined(ROARINGBITMAP_REQUIRE_POPCNT)
13
+ #if !(defined(__i386__) || defined(__x86_64__) || \
14
+ defined(_M_IX86) || defined(_M_X64))
15
+ return 0;
16
+ #elif defined(__GNUC__) || defined(__clang__)
17
+ return __builtin_cpu_supports("popcnt") != 0;
18
+ #elif defined(_MSC_VER)
19
+ int registers[4];
20
+ __cpuid(registers, 1);
21
+ return (registers[2] & (1 << 23)) != 0;
22
+ #else
23
+ return 0;
24
+ #endif
25
+ #else
26
+ return 1;
27
+ #endif
28
+ }
29
+
30
+ #endif