Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix #1691: is_executor template specification fails for inherited exe…
…cutors - types derived from parallel::executor_tag are treated as executors by default
- Loading branch information
Showing
11 changed files
with
103 additions
and
75 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# Copyright (c) 2014-2015 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) | ||
|
||
set(tests | ||
is_executor_1691 | ||
) | ||
|
||
foreach(test ${tests}) | ||
set(sources | ||
${test}.cpp) | ||
|
||
set(${test}_PARAMETERS THREADS_PER_LOCALITY 4) | ||
|
||
source_group("Source Files" FILES ${sources}) | ||
|
||
# add example executable | ||
add_hpx_executable(${test}_test | ||
SOURCES ${sources} | ||
${${test}_FLAGS} | ||
EXCLUDE_FROM_ALL | ||
HPX_PREFIX ${HPX_BUILD_PREFIX} | ||
FOLDER "Tests/Regressions/Parallel/Executors") | ||
|
||
add_hpx_unit_test("parallel" ${test} ${${test}_PARAMETERS}) | ||
|
||
# add a custom target for this example | ||
add_hpx_pseudo_target(tests.regressions.parallel_dir.executors_dir.${test}) | ||
|
||
# make pseudo-targets depend on master pseudo-target | ||
add_hpx_pseudo_dependencies(tests.regressions.parallel_dir.executors_dir | ||
tests.regressions.parallel_dir.executors_dir.${test}) | ||
|
||
# add dependencies to pseudo-target | ||
add_hpx_pseudo_dependencies(tests.regressions.parallel_dir.executors_dir.${test} | ||
${test}_test_exe) | ||
endforeach() |
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,33 @@ | ||
// Copyright (c) 2015 Daniel Bourgeois | ||
// | ||
// 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.hpp> | ||
#include <hpx/hpx_init.hpp> | ||
|
||
#include <hpx/include/parallel_executors.hpp> | ||
#include <hpx/include/parallel_algorithm.hpp> | ||
|
||
/////////////////////////////////////////////////////////////////////////////// | ||
struct my_executor : hpx::parallel::parallel_executor {}; | ||
|
||
/////////////////////////////////////////////////////////////////////////////// | ||
int hpx_main(int argc, char* argv[]) | ||
{ | ||
using hpx::parallel::for_each; | ||
using hpx::parallel::par; | ||
|
||
my_executor exec; | ||
|
||
std::vector<int> v(100); | ||
|
||
for_each(par.on(exec), v.begin(), v.end(), [](int x){ }); | ||
|
||
return hpx::finalize(); | ||
} | ||
|
||
int main(int argc, char* argv[]) | ||
{ | ||
return hpx::init(argc, argv); | ||
} |