mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-03-07 18:27:40 +08:00
Automatically include and link libxsmm when present.
This commit is contained in:
parent
f9eff17e91
commit
b91be60220
@ -84,6 +84,12 @@ macro(ei_add_test_internal testname testname_with_suffix)
|
||||
target_link_libraries(${targetname} ${EIGEN_TEST_CUSTOM_LINKER_FLAGS})
|
||||
endif()
|
||||
|
||||
if(XSMM_FOUND)
|
||||
include_directories(${XSMM_INCLUDES})
|
||||
link_directories(${XSMM_LIBRARIES})
|
||||
target_link_libraries(${targetname} xsmm)
|
||||
endif()
|
||||
|
||||
if(${ARGC} GREATER 3)
|
||||
set(libs_to_link ${ARGV3})
|
||||
# it could be that some cmake module provides a bad library string " " (just spaces),
|
||||
|
@ -1,24 +1,25 @@
|
||||
# libxsmm
|
||||
# libxsmm support.
|
||||
# libxsmm provides matrix multiplication kernels optimized for
|
||||
# the latest Intel architectures.
|
||||
# Download the library from https://github.com/hfp/libxsmm
|
||||
# Compile with make BLAS=0
|
||||
|
||||
if (XSMM_INCLUDES AND XSMM_LIBRARIES)
|
||||
if (LIBXSMM)
|
||||
set(XSMM_FIND_QUIETLY TRUE)
|
||||
endif (XSMM_INCLUDES AND XSMM_LIBRARIES)
|
||||
set(XSMM_INCLUDES ${LIBXSMM}/include)
|
||||
set(XSMM_LIBRARIES ${LIBXSMM}/lib)
|
||||
endif (LIBXSMM)
|
||||
|
||||
find_path(XSMM_INCLUDES
|
||||
find_path(LIBXSMM
|
||||
NAMES
|
||||
scotch.h
|
||||
libxsmm.h
|
||||
PATHS
|
||||
$ENV{XSMMDIR}
|
||||
$ENV{XSMMDIR}/include
|
||||
${INCLUDE_INSTALL_DIR}
|
||||
PATH_SUFFIXES
|
||||
scotch
|
||||
)
|
||||
|
||||
|
||||
find_library(XSMM_LIBRARIES xsmm PATHS $ENV{XSMMDIR} ${LIB_INSTALL_DIR})
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(XSMM DEFAULT_MSG
|
||||
XSMM_INCLUDES XSMM_LIBRARIES)
|
||||
LIBXSMM)
|
||||
|
||||
mark_as_advanced(XSMM_INCLUDES XSMM_LIBRARIES)
|
||||
mark_as_advanced(LIBXSMM)
|
||||
|
Loading…
Reference in New Issue
Block a user