Skip to content

Commit

Permalink
Fix logic to find sbgemm in BLAS library
Browse files Browse the repository at this point in the history
Current logic to set the HAS_SBGEMM flag is ignored in case the BLAS libraries are found
already, ie, if set from environment variable BLAS=OpenBLAS .
If BLAS_LIBRARIES are already set the code to find if BLAS_LIBRARY has sbgemm is never executed.
The following commit brings out this logic outside unconditionally.
  • Loading branch information
vinithakv committed Apr 30, 2024
1 parent f7f018a commit 5416fac
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions cmake/Modules/FindBLAS.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -385,16 +385,6 @@ IF (BLAS_LIBRARIES)
cmake_pop_check_state()
ENDIF(BLAS_LIBRARIES)

# Blas has bfloat16 support?
IF(BLAS_LIBRARIES)
SET(CMAKE_REQUIRED_LIBRARIES ${BLAS_LIBRARIES})
check_function_exists("sbgemm_" BLAS_HAS_SBGEMM)
set(CMAKE_REQUIRED_LIBRARIES)
IF(BLAS_HAS_SBGEMM)
add_compile_options(-DBLAS_HAS_SBGEMM)
ENDIF(BLAS_HAS_SBGEMM)
ENDIF(BLAS_LIBRARIES)

# epilogue

if(BLAS_LIBRARIES)
Expand All @@ -416,3 +406,13 @@ ENDIF(NOT BLAS_FIND_QUIETLY)

# Do nothing is BLAS was found before
ENDIF(NOT BLAS_FOUND)

# Blas has bfloat16 support?
IF(BLAS_LIBRARIES)
SET(CMAKE_REQUIRED_LIBRARIES ${BLAS_LIBRARIES})
check_function_exists("sbgemm_" BLAS_HAS_SBGEMM)
set(CMAKE_REQUIRED_LIBRARIES)
IF(BLAS_HAS_SBGEMM)
add_compile_options(-DBLAS_HAS_SBGEMM)
ENDIF(BLAS_HAS_SBGEMM)
ENDIF(BLAS_LIBRARIES)

0 comments on commit 5416fac

Please sign in to comment.