Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Making APEX actually picking up the annotated function name
- added support in for_each, for_loop, and transform
- Loading branch information
Showing
5 changed files
with
268 additions
and
5 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
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
49 changes: 49 additions & 0 deletions
49
tests/regressions/parallel/for_each_annotated_function.cpp
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,49 @@ | ||
// Copyright (c) 2017 Hartmut Kaiser | ||
// | ||
// 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/hpx_init.hpp> | ||
#include <hpx/hpx.hpp> | ||
#include <hpx/include/parallel_for_each.hpp> | ||
#include <hpx/util/lightweight_test.hpp> | ||
|
||
#include <algorithm> | ||
#include <numeric> | ||
#include <string> | ||
#include <vector> | ||
|
||
/////////////////////////////////////////////////////////////////////////////// | ||
int hpx_main() | ||
{ | ||
std::vector<int> c(10007); | ||
std::iota(boost::begin(c), boost::end(c), std::rand()); | ||
|
||
hpx::parallel::for_each( | ||
hpx::parallel::execution::par, c.begin(), c.end(), | ||
hpx::util::annotated_function( | ||
[](int i) -> void | ||
{ | ||
hpx::util::thread_description desc( | ||
hpx::threads::get_thread_description(hpx::threads::get_self_id()) | ||
); | ||
HPX_TEST(std::string(desc.get_description()) == "annotated_function"); | ||
}, | ||
"annotated_function" | ||
) | ||
); | ||
|
||
return hpx::finalize(); | ||
} | ||
|
||
int main(int argc, char* argv[]) | ||
{ | ||
std::vector<std::string> const cfg = { | ||
"hpx.os_threads=4" | ||
}; | ||
|
||
HPX_TEST_EQ_MSG(hpx::init(argc, argv, cfg), 0, | ||
"HPX main exited with non-zero status"); | ||
|
||
return hpx::util::report_errors(); | ||
} |