DRYer
This commit is contained in:
parent
cb5a2cce53
commit
bbaccfdaae
2 changed files with 8 additions and 2 deletions
|
|
@ -119,7 +119,8 @@ init_simd(void *x) {
|
|||
PyObject *module = (PyObject*)x;
|
||||
if (PyModule_AddFunctions(module, module_methods) != 0) return false;
|
||||
#define A(x, val) { Py_INCREF(Py_##val); if (0 != PyModule_AddObject(module, #x, Py_##val)) return false; }
|
||||
#define do_check() has_sse4_2 = __builtin_cpu_supports("sse4.2") != 0; has_avx2 = __builtin_cpu_supports("avx2") != 0;
|
||||
#define do_check() { has_sse4_2 = __builtin_cpu_supports("sse4.2") != 0; has_avx2 = __builtin_cpu_supports("avx2") != 0; }
|
||||
|
||||
#ifdef __APPLE__
|
||||
#ifdef __arm64__
|
||||
// simde takes care of NEON on Apple Silicon
|
||||
|
|
@ -136,6 +137,7 @@ init_simd(void *x) {
|
|||
do_check();
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#undef do_check
|
||||
if (has_avx2) {
|
||||
A(has_avx2, True);
|
||||
|
|
|
|||
|
|
@ -28,6 +28,8 @@
|
|||
Tuple,
|
||||
)
|
||||
|
||||
from . import BaseTest
|
||||
|
||||
|
||||
def contents(package: str) -> Iterator[str]:
|
||||
try:
|
||||
|
|
@ -269,6 +271,7 @@ def run_tests(report_env: bool = False) -> None:
|
|||
else:
|
||||
go_proc = None
|
||||
with env_for_python_tests(report_env):
|
||||
sys.stdout.flush()
|
||||
run_python_tests(args, go_proc)
|
||||
|
||||
|
||||
|
|
@ -295,7 +298,8 @@ def env_for_python_tests(report_env: bool = False) -> Iterator[None]:
|
|||
launcher_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'kitty', 'launcher')
|
||||
path = f'{launcher_dir}{os.pathsep}{path}'
|
||||
python_for_type_check()
|
||||
if os.environ.get('CI') == 'true' or report_env:
|
||||
print('Running under CI:', BaseTest.is_ci)
|
||||
if BaseTest.is_ci or report_env:
|
||||
print('Using PATH in test environment:', path)
|
||||
print('Python:', python_for_type_check())
|
||||
from kitty.fast_data_types import has_avx2, has_sse4_2
|
||||
|
|
|
|||
Loading…
Reference in a new issue