Skip to content

Commit 8279247

Browse files
committed
temp
1 parent 29f9bb4 commit 8279247

File tree

4 files changed

+28
-11
lines changed

4 files changed

+28
-11
lines changed

.github/workflows/prerelease.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ jobs:
323323
run: |
324324
python -m pip install --upgrade pip
325325
pip install pytest pytest-repeat numpy pyarrow
326-
python -m pip install .
326+
python -m pip install . -vv
327327
- name: Test Python
328328
run: pytest scripts/test.py -s -x
329329

include/stringzilla/stringzilla.h

+15-7
Original file line numberDiff line numberDiff line change
@@ -1106,50 +1106,58 @@ SZ_PUBLIC void sz_sort_intro(sz_sequence_t *sequence, sz_sequence_comparator_t l
11061106
* All of those can be controlled by the user.
11071107
*/
11081108
#ifndef SZ_USE_X86_AVX512
1109-
#ifdef __AVX512BW__
1109+
#if defined(__AVX512BW__) //&& SZ_TARGET_X86
11101110
#define SZ_USE_X86_AVX512 1
1111+
#pragma message("SZ_USE_X86_AVX512")
11111112
#else
11121113
#define SZ_USE_X86_AVX512 0
1114+
#pragma message("NOT SZ_USE_X86_AVX512")
11131115
#endif
11141116
#endif
11151117

11161118
#ifndef SZ_USE_X86_AVX2
1117-
#ifdef __AVX2__
1119+
#if defined(__AVX2__) //&& SZ_TARGET_X86
11181120
#define SZ_USE_X86_AVX2 1
1121+
#pragma message("SZ_USE_X86_AVX2")
11191122
#else
11201123
#define SZ_USE_X86_AVX2 0
1124+
#pragma message("NOT SZ_USE_X86_AVX2")
11211125
#endif
11221126
#endif
11231127

11241128
#ifndef SZ_USE_ARM_NEON
1125-
#if defined(__ARM_NEON) || defined(_M_ARM64)
1129+
#if (defined(__ARM_NEON) || defined(_M_ARM64))// && SZ_TARGET_ARM
11261130
#define SZ_USE_ARM_NEON 1
1131+
#pragma message("SZ_USE_ARM_NEON")
11271132
#else
11281133
#define SZ_USE_ARM_NEON 0
1134+
#pragma message("NOT SZ_USE_ARM_NEON")
11291135
#endif
11301136
#endif
11311137

11321138
#ifndef SZ_USE_ARM_SVE
1133-
#if defined(__ARM_FEATURE_SVE)
1139+
#if defined(__ARM_FEATURE_SVE)// && SZ_TARGET_ARM
11341140
#define SZ_USE_ARM_SVE 1
1141+
#pragma message("SZ_USE_ARM_SVE")
11351142
#else
11361143
#define SZ_USE_ARM_SVE 0
1144+
#pragma message("NOT SZ_USE_ARM_SVE")
11371145
#endif
11381146
#endif
11391147

11401148
/*
11411149
* Include hardware-specific headers.
11421150
*/
1143-
#if SZ_USE_X86_AVX512 || SZ_USE_X86_AVX2
1151+
#if (SZ_USE_X86_AVX512 || SZ_USE_X86_AVX2) && SZ_TARGET_X86
11441152
#include <immintrin.h>
11451153
#endif // SZ_USE_X86...
1146-
#if SZ_USE_ARM_NEON
1154+
#if SZ_USE_ARM_NEON && SZ_TARGET_ARM
11471155
#if !defined(_MSC_VER)
11481156
#include <arm_acle.h>
11491157
#endif
11501158
#include <arm_neon.h>
11511159
#endif // SZ_USE_ARM_NEON
1152-
#if SZ_USE_ARM_SVE
1160+
#if SZ_USE_ARM_SVE && SZ_TARGET_ARM
11531161
#if !defined(_MSC_VER)
11541162
#include <arm_sve.h>
11551163
#endif

pyproject.toml

+6
Original file line numberDiff line numberDiff line change
@@ -116,3 +116,9 @@ environment.SZ_ARM64="1"
116116
select = "*-macos*_arm64"
117117
inherit.environment = "append"
118118
environment.SZ_ARM64="1"
119+
120+
[[tool.cibuildwheel.overrides]]
121+
select = "*-macos*_universal2"
122+
inherit.environment = "append"
123+
environment.SZ_X86_64="1"
124+
environment.SZ_ARM64="1"

setup.py

+6-3
Original file line numberDiff line numberDiff line change
@@ -80,16 +80,19 @@ def darwin_settings() -> Tuple[List[str], List[str], List[Tuple[str]]]:
8080
"-fPIC", # to enable dynamic dispatch
8181
]
8282

83+
print("system", sysconfig.get_platform())
84+
8385
# Apple Clang doesn't support the `-march=native` argument,
8486
# so we must pre-set the CPU generation. Technically the last Intel-based Apple
8587
# product was the 2021 MacBook Pro, which had the "Coffee Lake" architecture.
8688
# During Universal builds, however, even AVX header cause compilation errors.
87-
can_use_avx2 = is_64bit_x86() and sysconfig.get_platform().startswith("universal")
89+
is_building_x86 = is_64bit_x86() and "universal" in sysconfig.get_platform()
90+
is_building_arm = is_64bit_arm() and "universal" in sysconfig.get_platform()
8891
macros_args = [
8992
("SZ_USE_X86_AVX512", "0"),
90-
("SZ_USE_X86_AVX2", "1" if can_use_avx2 else "0"),
93+
("SZ_USE_X86_AVX2", "1" if is_building_x86 else "0"),
9194
("SZ_USE_ARM_SVE", "0"),
92-
("SZ_USE_ARM_NEON", "1" if is_64bit_arm() else "0"),
95+
("SZ_USE_ARM_NEON", "1" if is_building_arm else "0"),
9396
]
9497

9598
return compile_args, link_args, macros_args

0 commit comments

Comments
 (0)