Skip to content

Commit 8692bb2

Browse files
authored
feat(pkg): compat.opencv windows dnn (fast_gemm) → dnn on all 3 platforms (#105)
* feat(pkg): compat.opencv windows dnn via built-in fast_gemm (mlas skipped — GAS .S not COFF-assemblable) → dnn on all 3 platforms * fix: strip mlas sources (incl mlas_hgemm_stub, #includes mlas.h) on windows — mlas is skipped there, DNN uses fast_gemm * tests: opencv-module-dnn stays linux+macOS (opencv-m module pkg not windows-enabled yet); compat opencv-dnn keeps windows (fast_gemm dnn — CI-passing)
1 parent 3dd4175 commit 8692bb2

6 files changed

Lines changed: 808 additions & 100 deletions

File tree

.github/workflows/snapshot-windows-opencv.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# question: does mcpp clang-MSVC compile OpenCV's C++ from a clang-cl snapshot.
77
# videoio+FFmpeg is a follow-up. Uploads the descriptor AND raw artifacts.
88
name: snapshot-windows-opencv
9-
on: { workflow_dispatch: {}, push: { branches: [feat/opencv-windows-videoio, feat/opencv-full-func] } }
9+
on: { workflow_dispatch: {}, push: { branches: [feat/opencv-windows-videoio, feat/opencv-full-func, feat/opencv-windows-dnn] } }
1010
jobs:
1111
snapshot:
1212
runs-on: windows-latest
@@ -57,6 +57,14 @@ jobs:
5757
echo "b0528f5a1d379d59d4701cb28c36e22214cc51cf64594e5b56f2d3e6c0233095 opencv.tar.gz" | sha256sum -c -
5858
tar -xzf opencv.tar.gz
5959
echo "OPENCV_SRC=$PWD/opencv-5.0.0" >> "$GITHUB_ENV"
60+
# DNN on windows: skip the vendored mlas. Its x86 kernels are GAS/ELF `.S`
61+
# (`.type …,@function`) which clang-cl cannot assemble to COFF. This is exactly
62+
# upstream's OWN fallback — 3rdparty/mlas/CMakeLists.txt bails when no usable
63+
# ASM is present, and DNN uses its built-in fast_gemm (`.cpp` AVX/AVX2 kernels).
64+
# Force that path by returning early from the mlas subdir on WIN32.
65+
MLAS="$PWD/opencv-5.0.0/3rdparty/mlas/CMakeLists.txt"
66+
printf 'if(WIN32)\n message(STATUS "mcpp: skip mlas on windows (GAS .S not COFF-assemblable); DNN uses built-in fast_gemm")\n return()\nendif()\n' | cat - "$MLAS" > "$MLAS.tmp" && mv "$MLAS.tmp" "$MLAS"
67+
head -6 "$MLAS"
6068
# Instrument detect_ffmpeg.cmake: at the very end (after ocv_add_external_target),
6169
# confirm the FindFFMPEG shim drove HAVE_FFMPEG=TRUE and the ocv.3rdparty.ffmpeg
6270
# INTERFACE target got created — that target (not HAVE_FFMPEG itself) is what

0 commit comments

Comments
 (0)