Skip to content

Commit 5940aad

Browse files
committed
Update examples and require HPX 1.7.0
1 parent 855e519 commit 5940aad

18 files changed

Lines changed: 48 additions & 62 deletions

File tree

examples/00_exercises/CMakeLists.txt

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
cmake_minimum_required(VERSION 3.0)
77
project(Exercises CXX)
88

9-
find_package(HPX REQUIRED)
9+
find_package(HPX 1.7.0 REQUIRED)
1010

1111
set(solutions
1212
solution1
@@ -29,15 +29,17 @@ set(exercises
2929
exercise8)
3030

3131
foreach(exercise ${exercises})
32-
add_hpx_executable(${exercise}
33-
SOURCES ${exercise}.cpp
34-
COMPONENT_DEPENDENCIES iostreams partitioned_vector)
32+
add_executable(${exercise} ${exercise}.cpp)
33+
target_link_libraries(
34+
${exercise} PRIVATE HPX::hpx HPX::wrap_main HPX::iostreams_component
35+
HPX::partitioned_vector_component)
3536
endforeach()
3637

3738
foreach(solution ${solutions})
38-
add_hpx_executable(${solution}
39-
SOURCES ${solution}.cpp
40-
COMPONENT_DEPENDENCIES iostreams partitioned_vector)
39+
add_executable(${solution} ${solution}.cpp)
40+
target_link_libraries(
41+
${solution} PRIVATE HPX::hpx HPX::wrap_main HPX::iostreams_component
42+
HPX::partitioned_vector_component)
4143
endforeach()
4244

4345
if(HPX_WITH_CUDA)

examples/00_exercises/exercise3.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ int main()
4848
hpx::when_all(f, g).then(&funX);
4949
hpx::when_all(v).then(&funX);
5050
hpx::dataflow(&funX, f, g);
51-
hpx::dataflow(hpx::util::unwrapping(&funX), f, g);
52-
hpx::dataflow(hpx::util::unwrapping(&funX), f, 3.14);
51+
hpx::dataflow(hpx::unwrapping(&funX), f, g);
52+
hpx::dataflow(hpx::unwrapping(&funX), f, 3.14);
5353

5454
return 0;
5555
}

examples/00_exercises/exercise7.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#include <hpx/execution.hpp>
1111
#include <hpx/include/actions.hpp>
1212
#include <hpx/iostream.hpp>
13+
#include <hpx/runtime.hpp>
1314
#include <hpx/wrap_main.hpp>
1415

1516
// This program does not compile because hello_locality is not an action, only a

examples/00_exercises/solution3.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,12 @@ int main()
3333
hpx::shared_future<double> f = hpx::make_ready_future(3.14);
3434
hpx::shared_future<int> g = hpx::make_ready_future(42);
3535

36-
// hpx::util::unwrapping and hpx::dataflow are convenient.
36+
// hpx::unwrapping and hpx::dataflow are convenient.
3737
hpx::async(&fun1, 3.14, 42);
3838
hpx::async(&fun1, f.get(), g.get());
3939
hpx::when_all(f, g).then(&fun2);
4040
hpx::dataflow(&fun3, f, g);
41-
hpx::dataflow(hpx::util::unwrapping(&fun1), f, g);
41+
hpx::dataflow(hpx::unwrapping(&fun1), f, g);
4242

4343
return 0;
4444
}

examples/00_exercises/solution6.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ hpx::future<double> tree_transform_reduce(
4242
hpx::future<double> right_result = hpx::async(
4343
&tree_transform_reduce<Transformer, Reducer>, n->right, t, r);
4444

45-
return hpx::dataflow(hpx::util::unwrapping(r), left_result, right_result);
45+
return hpx::dataflow(hpx::unwrapping(r), left_result, right_result);
4646
}
4747

4848
int main()

examples/00_exercises/solution7.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#include <hpx/execution.hpp>
1111
#include <hpx/include/actions.hpp>
1212
#include <hpx/iostream.hpp>
13+
#include <hpx/runtime.hpp>
1314
#include <hpx/wrap_main.hpp>
1415

1516
void hello_locality()

examples/01_hello_world/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66
cmake_minimum_required(VERSION 3.0)
77
project(Hello_World CXX)
88

9-
find_package(HPX REQUIRED)
9+
find_package(HPX 1.7.0 REQUIRED)
1010
link_directories(${HPX_LIBRARY_DIR})
1111

1212
add_executable(hello_world hello_world.cpp)
13-
hpx_setup_target(hello_world COMPONENT_DEPENDENCIES iostreams)
13+
target_link_libraries(hello_world PRIVATE HPX::hpx HPX::wrap_main HPX::iostreams_component)
1414

1515
# for tutorial target
1616
if (TARGET tutorial)

examples/01_hello_world/hello_world.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include <hpx/execution.hpp>
1313
#include <hpx/include/actions.hpp>
1414
#include <hpx/iostream.hpp>
15+
#include <hpx/runtime.hpp>
1516
#include <hpx/wrap_main.hpp>
1617

1718
#include <boost/range/irange.hpp>

examples/02_overhead/CMakeLists.txt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,10 @@
66
cmake_minimum_required(VERSION 3.0)
77
project(overhead CXX)
88

9-
find_package(HPX REQUIRED)
10-
link_directories(${HPX_LIBRARY_DIR})
9+
find_package(HPX 1.7.0 REQUIRED)
1110

1211
add_executable(future_overhead future_overhead.cpp)
13-
hpx_setup_target(future_overhead COMPONENT_DEPENDENCIES iostreams)
12+
target_link_libraries(future_overhead PRIVATE HPX::hpx HPX::wrap_main HPX::iostreams_component)
1413

1514
# for tutorial target
1615
if (TARGET tutorial)

examples/02_overhead/future_overhead.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,8 +232,8 @@ void measure_function_futures_limiting_executor(
232232
// start the clock
233233
high_resolution_timer walltime;
234234
{
235-
hpx::threads::executors::experimental::limiting_executor<Executor>
236-
signal_exec(exec, tasks, tasks + 1000);
235+
hpx::execution::experimental::limiting_executor<Executor> signal_exec(
236+
exec, tasks, tasks + 1000);
237237
for (std::uint64_t i = 0; i < count; ++i) {
238238
hpx::apply(signal_exec, [&](){
239239
null_function();

0 commit comments

Comments
 (0)