@@ -542,6 +542,11 @@ else()
542
542
endif ()
543
543
set_source_files_properties (${mlas_platform_srcs_sse2} PROPERTIES COMPILE_FLAGS "-msse2" )
544
544
545
+ set (mlas_platform_srcs_sse41
546
+ ${MLAS_SRC_DIR} /qgemm_kernel_sse41.cpp
547
+ )
548
+ set_source_files_properties (${mlas_platform_srcs_sse41} PROPERTIES COMPILE_FLAGS "-msse4.1" )
549
+
545
550
set (mlas_platform_srcs_avx
546
551
${MLAS_SRC_DIR} /x86_64/DgemmKernelAvx.S
547
552
${MLAS_SRC_DIR} /x86_64/SgemmKernelAvx.S
@@ -615,36 +620,65 @@ endif()
615
620
)
616
621
set_source_files_properties (${mlas_platform_srcs_avx512vnni} PROPERTIES COMPILE_FLAGS "-mfma -mavx512vnni -mavx512bw -mavx512dq -mavx512vl -mavx512f" )
617
622
623
+ set (mlas_platform_srcs_amx
624
+ ${MLAS_SRC_DIR} /x86_64/QgemmU8S8KernelAmxCommon.S
625
+ ${MLAS_SRC_DIR} /qgemm_kernel_amx.cpp
626
+ ${MLAS_SRC_DIR} /x86_64/QgemmU8S8KernelAmx.S
627
+ )
628
+ set_source_files_properties (${MLAS_SRC_DIR} /qgemm_kernel_amx.cpp PROPERTIES COMPILE_FLAGS "-mavx2 -mavx512bw -mavx512dq -mavx512vl -mavx512f" )
629
+ set_source_files_properties (${MLAS_SRC_DIR} /x86_64/QgemmU8S8KernelAmx.S PROPERTIES COMPILE_FLAGS "-mavx2 -mavx512bw -mavx512dq -mavx512vl -mavx512f" )
630
+
618
631
set (mlas_platform_srcs
619
632
${MLAS_SRC_DIR} /activate_fp16.cpp
620
633
${MLAS_SRC_DIR} /dwconv.cpp
621
634
${MLAS_SRC_DIR} /dgemm.cpp
622
635
${MLAS_SRC_DIR} /pooling_fp16.cpp
623
- ${MLAS_SRC_DIR} /qgemm_kernel_avx2.cpp
624
636
${mlas_platform_srcs_sse2}
625
- ${mlas_platform_srcs_avx}
626
- ${mlas_platform_srcs_avx2}
627
- ${mlas_platform_srcs_avx512f}
628
- ${mlas_platform_srcs_avx512core}
629
- ${mlas_platform_srcs_avx512vnni}
630
637
)
631
638
632
- if (NOT onnxruntime_ORT_MINIMAL_BUILD)
639
+ if (NOT onnxruntime_DISABLE_SSE4)
640
+ set (mlas_platform_srcs
641
+ ${mlas_platform_srcs}
642
+ ${mlas_platform_srcs_sse41}
643
+ )
644
+ endif ()
645
+
646
+ if (NOT onnxruntime_DISABLE_AVX)
647
+ set (mlas_platform_srcs
648
+ ${mlas_platform_srcs}
649
+ ${mlas_platform_srcs_avx}
650
+ )
651
+ endif ()
652
+
653
+ if (NOT onnxruntime_DISABLE_AVX2)
654
+ set (mlas_platform_srcs
655
+ ${mlas_platform_srcs}
656
+ ${mlas_platform_srcs_avx2}
657
+ ${MLAS_SRC_DIR} /qgemm_kernel_avx2.cpp
658
+ )
659
+ endif ()
660
+
661
+ if (NOT onnxruntime_DISABLE_AVX512)
662
+ set (mlas_platform_srcs
663
+ ${mlas_platform_srcs}
664
+ ${mlas_platform_srcs_avx512f}
665
+ ${mlas_platform_srcs_avx512core}
666
+ ${mlas_platform_srcs_avx512vnni}
667
+ )
668
+ endif ()
669
+
670
+ if (NOT onnxruntime_ORT_MINIMAL_BUILD AND NOT onnxruntime_DISABLE_AVX512)
633
671
set (mlas_platform_srcs
634
672
${mlas_platform_srcs}
635
673
${MLAS_SRC_DIR} /q4gemm_avx512.cpp
636
674
)
637
675
set_source_files_properties (${MLAS_SRC_DIR} /q4gemm_avx512.cpp PROPERTIES COMPILE_FLAGS "-mfma -mavx512vnni -mavx512bw -mavx512dq -mavx512vl -mavx512f" )
638
676
endif ()
639
- if (NOT APPLE )
677
+ if (NOT APPLE AND NOT onnxruntime_DISABLE_AMX )
640
678
set (mlas_platform_srcs
641
679
${mlas_platform_srcs}
642
- ${MLAS_SRC_DIR} /x86_64/QgemmU8S8KernelAmxCommon.S
643
- ${MLAS_SRC_DIR} /qgemm_kernel_amx.cpp
644
- ${MLAS_SRC_DIR} /x86_64/QgemmU8S8KernelAmx.S
645
- )
646
- set_source_files_properties (${MLAS_SRC_DIR} /qgemm_kernel_amx.cpp PROPERTIES COMPILE_FLAGS "-mavx2 -mavx512bw -mavx512dq -mavx512vl -mavx512f" )
647
- set_source_files_properties (${MLAS_SRC_DIR} /x86_64/QgemmU8S8KernelAmx.S PROPERTIES COMPILE_FLAGS "-mavx2 -mavx512bw -mavx512dq -mavx512vl -mavx512f" )
680
+ ${mlas_platform_srcs_amx}
681
+ )
648
682
endif ()
649
683
650
684
if (ONNXRUNTIME_MLAS_MULTI_ARCH)
0 commit comments