-
-
Notifications
You must be signed in to change notification settings - Fork 448
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adapt cmake backend to support new datapar backend EVE
This enables to choose datapar backend for vectorization by passing flags -DHPX_WITH_DATAPAR_BACKEND=${BACKEND} ${BACKEND} can be DATAPAR_VC OR DATAPAR_STD_EXPERIMENTAL_SIMD OR DATAPAR_EVE
- Loading branch information
srinivasyadav18
committed
Jun 17, 2022
1 parent
2a665ca
commit 0acc2bf
Showing
10 changed files
with
241 additions
and
23 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,61 @@ | ||
# Copyright (c) 2022 Srinivas Yadav | ||
# | ||
# SPDX-License-Identifier: BSL-1.0 | ||
# Distributed under the Boost Software License, Version 1.0. (See accompanying | ||
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) | ||
|
||
if(NOT TARGET Eve::eve) | ||
find_path( | ||
EVE_INCLUDE_DIR eve/eve.hpp | ||
HINTS "${EVE_ROOT}" ENV EVE_ROOT "${HPX_EVE_ROOT}" | ||
PATH_SUFFIXES include | ||
) | ||
|
||
if(NOT EVE_INCLUDE_DIR) | ||
hpx_error( | ||
"Could not find Eve. Set EVE_ROOT as a CMake or environment variable to point to the Eve root install directory. Alternatively, set HPX_WITH_FETCH_DATAPAR_EVE=ON to fetch Eve using CMake's FetchContent (when using this option Eve will be installed together with HPX, be careful about conflicts with separately installed versions of Eve)." | ||
) | ||
endif() | ||
|
||
# Set EVE_ROOT in case the other hints are used | ||
if(EVE_ROOT) | ||
# The call to file is for compatibility with windows paths | ||
file(TO_CMAKE_PATH ${EVE_ROOT} EVE_ROOT) | ||
elseif("$ENV{EVE_ROOT}") | ||
file(TO_CMAKE_PATH $ENV{EVE_ROOT} EVE_ROOT) | ||
else() | ||
file(TO_CMAKE_PATH "${EVE_INCLUDE_DIR}" EVE_INCLUDE_DIR) | ||
string(REPLACE "/include" "" EVE_ROOT "${EVE_INCLUDE_DIR}") | ||
endif() | ||
|
||
if(EVE_INCLUDE_DIR AND EXISTS "${EVE_INCLUDE_DIR}/eve/version.hpp") | ||
# Matches a line of the form: | ||
# | ||
# #define EVE_VERSION "AA.BB.CC.DD" | ||
# | ||
# with arbitrary whitespace between the tokens | ||
file( | ||
STRINGS "${EVE_INCLUDE_DIR}/eve/version.hpp" EVE_VERSION_DEFINE_LINE | ||
REGEX | ||
"#define[ \t]+EVE_LIB_VERSION[ \t]+\"+[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+\"[ \t]*" | ||
) | ||
# Extracts the dotted version number in quotation marks as | ||
# EVE_VERSION_STRING | ||
string(REGEX | ||
REPLACE "#define EVE_LIB_VERSION \"([0-9]+\.[0-9]+\.[0-9]+\.[0-9])\"" | ||
"\\1" EVE_VERSION_STRING "${EVE_VERSION_DEFINE_LINE}" | ||
) | ||
endif() | ||
|
||
include(FindPackageHandleStandardArgs) | ||
find_package_handle_standard_args( | ||
Eve | ||
REQUIRED_VARS EVE_INCLUDE_DIR | ||
VERSION_VAR EVE_VERSION_STRING | ||
) | ||
|
||
add_library(Eve::eve INTERFACE IMPORTED) | ||
target_include_directories(Eve::eve SYSTEM INTERFACE ${EVE_INCLUDE_DIR}) | ||
|
||
mark_as_advanced(EVE_ROOT EVE_INCLUDE_DIR EVE_VERSION_STRING) | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
# Copyright (c) 2022 Srinivas Yadav | ||
# | ||
# SPDX-License-Identifier: BSL-1.0 | ||
# Distributed under the Boost Software License, Version 1.0. (See accompanying | ||
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) | ||
|
||
if(HPX_WITH_FETCH_DATAPAR_EVE) | ||
if(FETCHCONTENT_SOURCE_DIR_EVE) | ||
hpx_info( | ||
"HPX_WITH_FETCH_DATAPAR_EVE=${HPX_WITH_FETCH_DATAPAR_EVE}, EVE will be used through CMake's FetchContent and installed alongside HPX (FETCHCONTENT_SOURCE_DIR_EVE=${FETCHCONTENT_SOURCE_DIR_EVE})" | ||
) | ||
else() | ||
hpx_info( | ||
"HPX_WITH_FETCH_DATAPAR_EVE=${HPX_WITH_FETCH_DATAPAR_EVE}, EVE will be fetched using CMake's FetchContent and installed alongside HPX (HPX_WITH_DATAPAR_EVE_TAG=${HPX_WITH_DATAPAR_EVE_TAG})" | ||
) | ||
endif() | ||
include(FetchContent) | ||
FetchContent_Declare( | ||
eve | ||
GIT_REPOSITORY https://github.com/jfalcou/eve.git | ||
GIT_TAG ${HPX_WITH_DATAPAR_EVE_TAG} | ||
) | ||
|
||
fetchcontent_getproperties(eve) | ||
if(NOT eve_POPULATED) | ||
fetchcontent_populate(eve) | ||
endif() | ||
set(EVE_ROOT ${eve_SOURCE_DIR}) | ||
|
||
add_library(eve INTERFACE) | ||
target_include_directories( | ||
eve SYSTEM INTERFACE $<BUILD_INTERFACE:${EVE_ROOT}/include/> | ||
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}> | ||
) | ||
|
||
install( | ||
TARGETS eve | ||
EXPORT HPXEveTarget | ||
COMPONENT core | ||
) | ||
|
||
install( | ||
DIRECTORY ${EVE_ROOT}/include/ | ||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} | ||
COMPONENT core | ||
FILES_MATCHING | ||
PATTERN "*.hpp" | ||
PATTERN "*.ipp" | ||
) | ||
|
||
export( | ||
TARGETS eve | ||
NAMESPACE Eve:: | ||
FILE "${CMAKE_CURRENT_BINARY_DIR}/lib/cmake/${HPX_PACKAGE_NAME}/HPXEveTarget.cmake" | ||
) | ||
|
||
install( | ||
EXPORT HPXEveTarget | ||
NAMESPACE Eve:: | ||
FILE HPXEveTarget.cmake | ||
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${HPX_PACKAGE_NAME} | ||
) | ||
|
||
add_library(Eve::eve ALIAS eve) | ||
|
||
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
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