-
-
Notifications
You must be signed in to change notification settings - Fork 437
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
145 additions
and
0 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,42 @@ | ||
# Copyright (c) 2023 Hari Hara Naveen S | ||
# | ||
# 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 SimdSort::simdsort) | ||
find_path(SIMD_SORT_INCLUDE_DIR avx512-16bit-qsort.hpp | ||
HINTS "${SIMD_SORT_ROOT}" ENV SIMD_SORT_ROOT | ||
"${HPX_SIMD_SORT_ROOT}" | ||
) | ||
|
||
if(NOT SIMD_SORT_INCLUDE_DIR) | ||
hpx_error("Simd Sort not found") | ||
endif() | ||
|
||
if(SIMD_SORT) | ||
# The call to file is for compatibility with windows paths | ||
file(TO_CMAKE_PATH ${SIMD_SORT} SIMD_SORT) | ||
elseif("$ENV{SIMD_SORT}") | ||
file(TO_CMAKE_PATH $ENV{SIMD_SORT} SIMD_SORT) | ||
else() | ||
file(TO_CMAKE_PATH "${SIMD_SORT_INCLUDE_DIR}" SIMD_SORT_INCLUDE_DIR) | ||
string(REPLACE "/src" "" SIMD_SORT_ROOT "${SIMD_SORT_INCLUDE_DIR}") | ||
endif() | ||
|
||
include(FindPackageHandleStandardArgs) | ||
find_package_handle_standard_args( | ||
SimdSort | ||
REQUIRED_VARS SIMD_SORT_INCLUDE_DIR | ||
VERSION_VAR SIMD_SORT_VERSION_STRING | ||
) | ||
|
||
add_library(SimdSort::simdsort INTERFACE IMPORTED) | ||
target_include_directories( | ||
SimdSort::simdsort SYSTEM INTERFACE ${SIMD_SORT_INCLUDE_DIR} | ||
) | ||
|
||
mark_as_advanced( | ||
SIMD_SORT_ROOT SIMD_SORT_INCLUDE_DIR SIMD_SORT_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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
# Copyright (c) 2023 Hari Hara Naveen S | ||
# | ||
# 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_SIMD_SORT) | ||
if(FETCHCONTENT_SOURCE_DIR_SIMD_SORT) | ||
hpx_info( | ||
"HPX_WITH_FETCH_SIMD_SORT=${HPX_WITH_FETCH_SIMD_SORT}, x86-simd-sort will be used through CMake's FetchContent and installed alongside HPX (FETCHCONTENT_SOURCE_DIR_SIMD_SORT=${FETCHCONTENT_SOURCE_DIR_SIMD_SORT})" | ||
) | ||
else() | ||
hpx_info( | ||
"HPX_WITH_FETCH_SIMD_SORT=${HPX_WITH_FETCH_SIMD_SORT}, x86-simd-sort will be fetched using CMake's FetchContent and installed alongside HPX (HPX_WITH_SIMD_SORT_TAG=${HPX_WITH_SIMD_SORT_TAG})" | ||
) | ||
endif() | ||
|
||
include(FetchContent) | ||
fetchcontent_declare( | ||
simdsort | ||
GIT_REPOSITORY https://github.com/intel/x86-simd-sort | ||
GIT_TAG ${HPX_WITH_SIMD_SORT_TAG} | ||
) | ||
|
||
fetchcontent_getproperties(simdsort) | ||
if(NOT simdsort_POPULATED) | ||
fetchcontent_populate(simdsort) | ||
endif() | ||
set(SIMD_SORT_ROOT ${simdsort_SOURCE_DIR}) | ||
|
||
add_library(simdsort INTERFACE) | ||
target_include_directories( | ||
simdsort SYSTEM INTERFACE $<BUILD_INTERFACE:${SIMD_SORT_ROOT}/src/> | ||
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}> | ||
) | ||
|
||
install( | ||
TARGETS simdsort | ||
EXPORT HPXSimdSortTarget | ||
COMPONENT core | ||
) | ||
|
||
install( | ||
DIRECTORY ${SIMD_SORT_ROOT}/src/ | ||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} | ||
COMPONENT core | ||
FILES_MATCHING | ||
PATTERN "*.hpp" | ||
PATTERN "*.h" | ||
) | ||
|
||
export( | ||
TARGETS simdsort | ||
NAMESPACE SimdSort:: | ||
FILE "${CMAKE_CURRENT_BINARY_DIR}/lib/cmake/${HPX_PACKAGE_NAME}/HPXSimdSortTarget.cmake" | ||
) | ||
|
||
install( | ||
EXPORT HPXSimdSortTarget | ||
NAMESPACE SimdSort:: | ||
FILE HPXSimdSortTarget.cmake | ||
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${HPX_PACKAGE_NAME} | ||
) | ||
|
||
add_library(SimdSort::simdsort ALIAS simdsort) | ||
|
||
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
Empty file.