@@ -32,14 +32,12 @@ if (BLAS_FOUND)
3232 pkg_check_modules (DepBLAS openblas )
3333 endif ()
3434 elseif (${GGML_BLAS_VENDOR} MATCHES "FLAME" )
35- add_compile_definitions (GGML_BLAS_USE_BLIS )
3635 pkg_check_modules (DepBLAS blis )
3736 elseif (${GGML_BLAS_VENDOR} MATCHES "ATLAS" )
3837 pkg_check_modules (DepBLAS blas-atlas )
3938 elseif (${GGML_BLAS_VENDOR} MATCHES "FlexiBLAS" )
4039 pkg_check_modules (DepBLAS flexiblas_api )
4140 elseif (${GGML_BLAS_VENDOR} MATCHES "Intel" )
42- add_compile_definitions (GGML_BLAS_USE_MKL )
4341 # all Intel* libraries share the same include path
4442 pkg_check_modules (DepBLAS mkl-sdl )
4543 elseif (${GGML_BLAS_VENDOR} MATCHES "NVHPC" )
@@ -74,10 +72,26 @@ if (BLAS_FOUND)
7472
7573 target_compile_options (ggml-blas PRIVATE ${BLAS_LINKER_FLAGS} )
7674
77- if ("${BLAS_INCLUDE_DIRS} " MATCHES "mkl" AND (${GGML_BLAS_VENDOR} MATCHES "Generic" OR ${GGML_BLAS_VENDOR} MATCHES "Intel" ))
75+ if ("${GGML_BLAS_VENDOR} " STREQUAL "" )
76+ message (WARNING "GGML_BLAS_VENDOR is not set; some methods may not link properly." )
77+ endif ()
78+
79+ if ("${GGML_BLAS_VENDOR} " MATCHES "Intel" OR ("${BLAS_INCLUDE_DIRS} " MATCHES "mkl" AND "${GGML_BLAS_VENDOR} " MATCHES "Generic" ))
7880 add_compile_definitions (GGML_BLAS_USE_MKL )
7981 endif ()
8082
83+ if ("${GGML_BLAS_VENDOR} " MATCHES "OpenBLAS" )
84+ add_compile_definitions (GGML_BLAS_USE_OPENBLAS )
85+ endif ()
86+
87+ if ("${GGML_BLAS_VENDOR} " MATCHES "FLAME" OR "${GGML_BLAS_VENDOR} " MATCHES "AOCL" OR "${GGML_BLAS_VENDOR} " MATCHES "AOCL_mt" )
88+ add_compile_definitions (GGML_BLAS_USE_BLIS )
89+ endif ()
90+
91+ if ("${GGML_BLAS_VENDOR} " MATCHES "NVPL" )
92+ add_compile_definitions (GGML_BLAS_USE_NVPL )
93+ endif ()
94+
8195 target_link_libraries (ggml-blas PRIVATE ${BLAS_LIBRARIES} )
8296 target_include_directories (ggml-blas PRIVATE ${BLAS_INCLUDE_DIRS} )
8397else ()
0 commit comments