diff --git a/dev-libs/ncnn/files/ncnn-20241226-avx512.patch b/dev-libs/ncnn/files/ncnn-20241226-avx512.patch new file mode 100644 index 0000000000000..c4dcf8adb5005 --- /dev/null +++ b/dev-libs/ncnn/files/ncnn-20241226-avx512.patch @@ -0,0 +1,16 @@ +Quick fix for build with -march that enables avx512f. + +This is not where ncnn would include this though, it seems to have +tendency to put headers not where they're used by in every files +before including this. +--- a/src/layer/x86/gemm_int8.h ++++ b/src/layer/x86/gemm_int8.h +@@ -13,4 +13,8 @@ + // specific language governing permissions and limitations under the License. + ++#if __AVX512F__ ++#include "avx512_mathfun.h" ++#endif ++ + #if NCNN_RUNTIME_CPU && NCNN_AVX512VNNI && __AVX512F__ && !__AVX512VNNI__ + void pack_A_tile_int8_avx512vnni(const Mat& A, Mat& AT, int i, int max_ii, int k, int max_kk); diff --git a/dev-libs/ncnn/ncnn-20241226.ebuild b/dev-libs/ncnn/ncnn-20241226.ebuild index 7c8a0a3dd6bc3..44bde69b5d13a 100644 --- a/dev-libs/ncnn/ncnn-20241226.ebuild +++ b/dev-libs/ncnn/ncnn-20241226.ebuild @@ -41,6 +41,10 @@ BDEPEND=" DOCS=( README.md docs/. ) +PATCHES=( + "${FILESDIR}"/${P}-avx512.patch +) + pkg_pretend() { [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp }