Skip to content

Commit 0ecd485

Browse files
committed
fixup! wip
1 parent 9fa29b6 commit 0ecd485

2 files changed

Lines changed: 10 additions & 6 deletions

File tree

benchmark/benchmark-cppbktree.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -684,8 +684,10 @@ benchmarkBatchHammingLookup( const size_t valueCount,
684684
std::cerr << "[benchmarkLinearHammingLookupSimpleBatch2] ";
685685
benchmarkLinearHammingLookupSimpleBatch2( hashes, needles, distance );
686686

687+
#ifdef __AVX2__
687688
std::cerr << "[benchmarkLinearHammingLookupSIMDBatch] ";
688689
benchmarkLinearHammingLookupSIMDBatch( hashes, needles, distance );
690+
#endif // ifdef __AVX2__
689691
}
690692

691693

setup.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# -*- coding: utf-8 -*-
33

44
import platform
5+
import sysconfig
56
import tempfile
67
from distutils.errors import CompileError
78

@@ -18,15 +19,16 @@
1819
cythonize = None
1920

2021

22+
withGIL = not sysconfig.get_config_var("Py_GIL_DISABLED")
23+
2124
class bdist_wheel_abi3(bdist_wheel):
2225
def get_tag(self):
2326
python, abi, plat = super().get_tag()
24-
if python.startswith("cp"):
25-
# On CPython, our wheels are abi3 and compatible back to 3.9.
26-
return "cp39", "abi3", plat
27+
if withGIL and python.startswith("cp"):
28+
# On CPython, our wheels are abi3 and compatible back to 3.8.
29+
return "cp38", "abi3", plat
2730
return python, abi, plat
2831

29-
3032
extensions = [
3133
Extension(
3234
# fmt: off
@@ -36,8 +38,8 @@ def get_tag(self):
3638
language = 'c++',
3739
# https://docs.python.org/3/c-api/stable.html#c.Py_LIMITED_API
3840
# https://docs.python.org/3/c-api/apiabiversion.html#c.Py_Version
39-
define_macros=[("Py_LIMITED_API", "0x030900f0")],
40-
py_limited_api=True,
41+
define_macros=[("Py_LIMITED_API", "0x030800f0")] if withGIL else [],
42+
py_limited_api=withGIL,
4143
# fmt: on
4244
),
4345
]

0 commit comments

Comments
 (0)