Skip to content

Commit 8ae86e6

Browse files
committed
Fix AVX2 detection bug
1 parent fd2d735 commit 8ae86e6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

CLI/videocr/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import subprocess
66
import sys
77

8-
from cpuid import cpuid, xgetbv
8+
from cpuid import cpuid, cpuid_count, xgetbv
99

1010
from .lang_dictionaries import (
1111
ARABIC_LANGS,
@@ -229,7 +229,7 @@ def has_avx2_and_fma() -> bool:
229229
ymm_supported = False
230230

231231
# CPUID leaf 7: AVX2
232-
_, ebx, _, _ = cpuid(7)
232+
_, ebx, _, _ = cpuid_count(7, 0)
233233
avx2 = bool(ebx & (1 << 5))
234234

235235
return osxsave and avx and avx2 and fma and ymm_supported

0 commit comments

Comments
 (0)