diff options
author | Benoit Steiner <benoit.steiner.goog@gmail.com> | 2016-12-21 13:44:59 -0800 |
---|---|---|
committer | Benoit Steiner <benoit.steiner.goog@gmail.com> | 2016-12-21 13:44:59 -0800 |
commit | b91be60220d26335d3c7e205d09a34798e7a4c0c (patch) | |
tree | 96f6cb28071be580bad27404668ef46030bb4e5b /cmake | |
parent | f9eff17e915e270e654287723cea67be495f5c5f (diff) |
Automatically include and link libxsmm when present.
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/EigenTesting.cmake | 6 | ||||
-rw-r--r-- | cmake/FindXsmm.cmake | 27 |
2 files changed, 20 insertions, 13 deletions
diff --git a/cmake/EigenTesting.cmake b/cmake/EigenTesting.cmake index a92a2978b..a83b9435e 100644 --- a/cmake/EigenTesting.cmake +++ b/cmake/EigenTesting.cmake @@ -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), diff --git a/cmake/FindXsmm.cmake b/cmake/FindXsmm.cmake index 745414c72..809d6f414 100644 --- a/cmake/FindXsmm.cmake +++ b/cmake/FindXsmm.cmake @@ -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) |