Skip to content

Commit cfe3631

Browse files
authored
Merge pull request #132 from jcarpent/devel
Enforce check for other architectures
2 parents aaa4618 + bf2ea11 commit cfe3631

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

bindings/python/proxsuite/__init__.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
import platform
22

3-
if "arm" not in platform.processor():
3+
machine = platform.machine()
4+
has_vectorization_instructions = not machine.startswith(
5+
("arm", "aarch64", "power", "ppc64", "s390x", "sparc")
6+
)
7+
if has_vectorization_instructions:
48
from . import instructionset
59

610

@@ -16,7 +20,7 @@ def load_module(main_module_name):
1620
except ModuleNotFoundError:
1721
return False
1822

19-
if "arm" not in platform.processor():
23+
if has_vectorization_instructions:
2024
all_modules = [
2125
("proxsuite_pywrap_avx512", instructionset.has_AVX512F),
2226
("proxsuite_pywrap_avx2", instructionset.has_AVX2),
@@ -32,3 +36,5 @@ def load_module(main_module_name):
3236
load_main_module(globals=globals())
3337
del load_main_module
3438
del platform
39+
del has_vectorization_instructions
40+
del machine

0 commit comments

Comments
 (0)