-
Notifications
You must be signed in to change notification settings - Fork 141
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3357 from ye-luo/separate-omptarget-math
Adjust scalar/vector math function handling
- Loading branch information
Showing
39 changed files
with
304 additions
and
240 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# Output: HAVE_AMD_LIBM | ||
|
||
message(STATUS "Setting up AMD LibM libraries") | ||
message(WARNING "In limited benchmarks, AMD LibM slows down QMCPACK. " | ||
"Please check carefully before using it in production runs.") | ||
|
||
include(CheckCXXSourceCompiles) | ||
|
||
find_path( | ||
AMD_LIBM_INCLUDE_DIR NAME amdlibm.h | ||
HINTS ${AMD_LIBM_ROOT} ${AOCL_ROOT} | ||
PATH_SUFFIXES include) | ||
|
||
if(NOT AMD_LIBM_INCLUDE_DIR) | ||
message(FATAL_ERROR "AMD_LIBM_INCLUDE_DIR not set. Header file amdlib.h not found!") | ||
else() | ||
message(STATUS "Header file amdlib.h found at ${AMD_LIBM_INCLUDE_DIR}") | ||
endif() | ||
|
||
find_library( | ||
AMD_LIBM_LIBRARY NAME amdlibm | ||
HINTS ${AMD_LIBM_ROOT} ${AOCL_ROOT} | ||
PATH_SUFFIXES lib) | ||
|
||
if(NOT AMD_LIBM_LIBRARY) | ||
message(FATAL_ERROR "AMD_LIBM_LIBRARY not set. Library file amdlibm not found!") | ||
else() | ||
message(STATUS "Library file amdlibm found as ${AMD_LIBM_LIBRARY}") | ||
endif() | ||
|
||
set(CMAKE_REQUIRED_INCLUDES "${AMD_LIBM_INCLUDE_DIR}") | ||
set(CMAKE_REQUIRED_LIBRARIES "${AMD_LIBM_LIBRARY}") | ||
check_cxx_source_compiles( | ||
" | ||
#include <amdlibm.h> | ||
int main() { | ||
double d_in(0), d_sin, d_cos; | ||
amd_sincos(d_in, &d_sin, &d_cos); | ||
float s_in(0), s_sin, s_cos; | ||
amd_sincosf(s_in, &s_sin, &s_cos); | ||
return 0; | ||
} | ||
" | ||
HAVE_AMD_LIBM) | ||
unset(CMAKE_REQUIRED_INCLUDES) | ||
unset(CMAKE_REQUIRED_LIBRARIES) | ||
|
||
if(HAVE_AMD_LIBM) | ||
target_compile_definitions(Math::scalar_vector_functions INTERFACE "HAVE_AMD_LIBM") | ||
target_include_directories(Math::scalar_vector_functions INTERFACE "${AMD_LIBM_INCLUDE_DIR}") | ||
target_link_libraries(Math::scalar_vector_functions INTERFACE "${AMD_LIBM_LIBRARY}") | ||
message(STATUS "AMD LIBM found") | ||
else() | ||
message(FATAL_ERROR "AMD LIBM not found") | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Simple file to verify MKL VML | ||
# Input: MKL_FOUND, MKL_INCLUDE, MKL_LIBRARIES | ||
# Output: HAVE_MKL_VML | ||
|
||
message(STATUS "Setting up Intel MKL Vector Math Library (VML)") | ||
|
||
if(NOT MKL_FOUND) | ||
message(FATAL_ERROR "MKL was not found. Cannot proceed with Vector Math Library (VML) searching!") | ||
endif() | ||
|
||
include(CheckIncludeFileCXX) | ||
|
||
# Check for mkl_vml_functions.h | ||
set(CMAKE_REQUIRED_INCLUDES "${MKL_INCLUDE}") | ||
check_include_file_cxx(mkl_vml_functions.h HAVE_MKL_VML) | ||
unset(CMAKE_REQUIRED_INCLUDES) | ||
|
||
if(HAVE_MKL_VML) | ||
target_compile_definitions(Math::scalar_vector_functions INTERFACE "HAVE_MKL;HAVE_MKL_VML") | ||
target_include_directories(Math::scalar_vector_functions INTERFACE "${MKL_INCLUDE}") | ||
target_link_libraries(Math::scalar_vector_functions INTERFACE "${MKL_LIBRARIES}") | ||
message(STATUS "MKL VML found") | ||
else() | ||
message(FATAL_ERROR "MKL VML not found") | ||
endif(HAVE_MKL_VML) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.