-
-
Notifications
You must be signed in to change notification settings - Fork 439
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
1 parent
9c53b99
commit 1798cbc
Showing
7 changed files
with
162 additions
and
1 deletion.
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,36 @@ | ||
|
||
if(NOT TARGET STDEXEC::stdexec) | ||
if (STDEXEC_ROOT AND NOT Stdexec_ROOT) | ||
set(Stdexec_ROOT ${STDEXEC_ROOT} CACHE PATH "stdexec base directory") | ||
unset(STDEXEC_ROOT CACHE) | ||
endif() | ||
|
||
find_path( | ||
Stdexec_INCLUDE_DIR | ||
stdexec | ||
HINTS ${Stdexec_ROOT} | ||
) | ||
|
||
if (Stdexec_INCLUDE_DIR) | ||
file(TO_CMAKE_PATH ${Stdexec_INCLUDE_DIR} Stdexec_INCLUDE_DIR) | ||
else() | ||
message(FATAL_ERROR "stdexec not found") | ||
endif() | ||
|
||
include(FindPackageHandleStandardArgs) | ||
find_package_handle_standard_args( | ||
Stdexec | ||
REQUIRED_VARS Stdexec_INCLUDE_DIR | ||
FOUND_VAR Stdexec_FOUND | ||
VERSION_VAR Stdexec_VERSION | ||
FAIL_MESSAGE "stdexec not found" | ||
) | ||
|
||
add_library(STDEXEC::stdexec INTERFACE IMPORTED) | ||
target_include_directories(STDEXEC::stdexec SYSTEM INTERFACE ${Stdexec_INCLUDE_DIR}) | ||
|
||
|
||
|
||
|
||
mark_as_advanced(Stdexec_INCLUDE_DIR Stdexec_ROOT) | ||
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,34 @@ | ||
if(STDEXEC_ROOT AND NOT Stdexec_ROOT) | ||
set(Stdexec_ROOT | ||
${STDEXEC_ROOT} | ||
CACHE PATH "STDEXEC base directory" | ||
) | ||
unset(STDEXEC_ROOT CACHE) | ||
endif() | ||
|
||
if(HPX_WITH_FETCH_STDEXEC AND NOT Stdexec_ROOT) | ||
hpx_info( | ||
"HPX_WITH_FETCH_STDEXEC=${HPX_WITH_FETCH_STDEXEC}, Stdexec will be fetched using CMake's FetchContent." | ||
) | ||
if(UNIX) | ||
include(FetchContent) | ||
FetchContent_Declare( | ||
Stdexec | ||
GIT_REPOSITORY https://github.com/NVIDIA/stdexec.git | ||
GIT_TAG main | ||
) | ||
FetchContent_MakeAvailable(Stdexec) | ||
endif() | ||
|
||
add_library(STDEXEC::stdexec INTERFACE IMPORTED) | ||
target_include_directories(STDEXEC::stdexec INTERFACE ${stdexec_SOURCE_DIR}/include) | ||
target_link_libraries(STDEXEC::stdexec INTERFACE ${Stdexec_LIBRARY}) | ||
elseif(HPX_WITH_STDEXEC) | ||
find_package(Stdexec REQUIRED) | ||
|
||
if(NOT Stdexec_FOUND) | ||
hpx_error( | ||
"Stdexec could not be found, please specify Stdexec_ROOT to point to the correct location" | ||
) | ||
endif() | ||
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
15 changes: 15 additions & 0 deletions
15
libs/core/execution_base/include/hpx/execution_base/stdexec_forward.hpp
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,15 @@ | ||
// Copyright (c) 2023 Isidoros Tsaousis-Seiras | ||
// | ||
// 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) | ||
|
||
#pragma once | ||
|
||
#if defined(HPX_HAVE_STDEXEC) | ||
#include <stdexec/execution.hpp> | ||
|
||
namespace hpx::execution::experimental { | ||
using namespace stdexec; | ||
} | ||
#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,24 @@ | ||
// Copyright (c) 2023 Isidoros Tsaousis-Seiras | ||
// | ||
// 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) | ||
|
||
#include <hpx/init.hpp> | ||
#include <hpx/execution_base/stdexec_forward.hpp> | ||
|
||
#include <hpx/modules/testing.hpp> | ||
|
||
#include <utility> | ||
|
||
using namespace hpx::execution::experimental; | ||
|
||
int main() { | ||
auto x = just(42); | ||
|
||
auto [a] = sync_wait(std::move(x)).value(); | ||
|
||
HPX_TEST(a == 42); | ||
|
||
return hpx::util::report_errors(); | ||
} |