File tree Expand file tree Collapse file tree 1 file changed +2
-48
lines changed
Expand file tree Collapse file tree 1 file changed +2
-48
lines changed Original file line number Diff line number Diff line change 11#! /bin/sh
22
3- # SIMD detection for smol-cube
4- echo " Running SIMD detection"
5-
6- CXX=${CXX:- g++}
7- echo " Using compiler: $CXX "
8-
9- OS_TYPE=$( uname -s)
10- ARCH=$( uname -m)
11- SIMD_FLAGS=" "
12-
13- if [ " $ARCH " = " x86_64" ]; then
14- echo " Detected x86_64 architecture"
15-
16- TMPFILE=tmp_simd_check.cpp
17-
18- cat << EOF > $TMPFILE
19- #include <smmintrin.h>
20-
21- int main() {
22- __m128i a = _mm_set1_epi32(42); // SSE4.1 intrinsic
23- return 0;
24- }
25- EOF
26-
27- if $CXX -msse4.1 $TMPFILE -o /dev/null 2> /dev/null; then
28- SIMD_FLAGS=" -msse4.1"
29- echo " Compiler supports SSE4.1"
30- else
31- echo " Error: SSE4.1 support not available; cannot proceed"
32- rm -f $TMPFILE
33- exit 1
34- fi
35-
36- rm -f $TMPFILE
37-
38- elif [ " $ARCH " = " aarch64" ] || [ " $ARCH " = " arm64" ]; then
39- if [ " $OS_TYPE " = " Darwin" ]; then
40- SIMD_FLAGS=" " # Clang on macOS enables NEON by default
41- echo " Detected Apple Silicon (arm64 macOS); using default flags"
42- else
43- SIMD_FLAGS=" -march=armv8-a"
44- echo " Detected ARM64 architecture; using $SIMD_FLAGS "
45- fi
46- else
47- echo " Unsupported architecture: $ARCH "
48- exit 1
49- fi
50-
3+ # CXX=${CXX:-g++}
4+ # echo "Using compiler: $CXX"
515
526# Anticonf (tm) script by Jeroen Ooms (2020)
537PKG_CONFIG_NAME=" opencv4"
You can’t perform that action at this time.
0 commit comments