Skip to content

Commit ed91c6e

Browse files
committed
fix: strip mlas sources (incl mlas_hgemm_stub, #includes mlas.h) on windows — mlas is skipped there, DNN uses fast_gemm
1 parent f095a18 commit ed91c6e

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

pkgs/c/compat.opencv.lua

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7331,7 +7331,6 @@ jpeg16 3rdparty/libjpeg-turbo/src/jutils.c
73317331
"mcpp_generated/modules/dnn/layers/{layers_common.avx,layers_common.avx2,layers_common.avx512_skx}.cpp",
73327332
[[
73337333
mcpp_generated/modules/dnn/layers/cpu_kernels/{activation_kernels.avx,activation_kernels.avx2,conv2_depthwise.avx,conv2_depthwise.avx2,conv2_kernels.avx,conv2_kernels.avx2,conv_block.avx,conv_block.avx2,conv_depthwise.avx,conv_depthwise.avx2,conv_winograd_f63.avx,conv_winograd_f63.avx2,fast_gemm_kernels.avx,fast_gemm_kernels.avx2,gridsample_kernels.avx,gridsample_kernels.avx2,nary_eltwise_kernels.avx,nary_eltwise_kernels.avx2,reduce2_kernels.avx,reduce2_kernels.avx2,transpose_kernels.avx,transpose_kernels.avx2}.cpp]],
7334-
"mcpp_generated/mlas_hgemm_stub.cpp",
73357334
},
73367335
},
73377336
},

tools/compat-opencv/merge_opencv.lua

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,9 @@ local function is_mlas_glob(f)
162162
return type(f) == "table" and type(f.glob) == "string"
163163
and f.glob:find("3rdparty/mlas", 1, true) ~= nil
164164
end
165+
-- any mlas SOURCE (incl the curated mcpp_generated/mlas_hgemm_stub.cpp, which
166+
-- #includes "mlas.h") — dead on windows where mlas is skipped entirely.
167+
local function is_mlas_src(s) return type(s) == "string" and s:find("mlas", 1, true) ~= nil end
165168
-- clsrc/opencl_kernels_<m>.cpp are written INERT by build.mcpp (cl2cpp) but never
166169
-- compiled (OpenCL OFF in this headless profile, not registered as sources), so
167170
-- their per-file flag-globs match nothing -> a permanent "[build].flags glob …
@@ -178,7 +181,9 @@ for _, os_ in ipairs(order) do
178181
local feat = (p.mcpp.features and p.mcpp.features.dnn) or {}
179182
local srcs, flgs, cleaned = {}, {}, {}
180183
local drop_mlas = (os_ == "windows") -- windows uses fast_gemm, no mlas
181-
for _, s in ipairs(feat.sources or {}) do if not is_vkcom(s) then srcs[#srcs+1] = s end end
184+
for _, s in ipairs(feat.sources or {}) do
185+
if not is_vkcom(s) and not (drop_mlas and is_mlas_src(s)) then srcs[#srcs+1] = s end
186+
end
182187
for _, f in ipairs(feat.flags or {}) do
183188
if not (drop_mlas and is_mlas_glob(f)) then flgs[#flgs+1] = f end
184189
end

0 commit comments

Comments
 (0)