-
-
Notifications
You must be signed in to change notification settings - Fork 438
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
6309: Making sure changed number of cores is propagated to executor r=hkaiser a=hkaiser Co-authored-by: Hartmut Kaiser <[email protected]>
- Loading branch information
Showing
35 changed files
with
1,044 additions
and
405 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
// Copyright (c) 2023 Hartmut Kaiser | ||
// | ||
// 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/algorithm.hpp> | ||
#include <hpx/chrono.hpp> | ||
#include <hpx/execution.hpp> | ||
#include <hpx/init.hpp> | ||
#include <hpx/modules/testing.hpp> | ||
|
||
#include <cstddef> | ||
|
||
int hpx_main() | ||
{ | ||
hpx::execution::experimental::num_cores nc(2); | ||
auto policy = hpx::execution::par.with(nc); | ||
|
||
HPX_TEST_EQ( | ||
hpx::parallel::execution::processing_units_count(policy.parameters(), | ||
policy.executor(), hpx::chrono::null_duration, 0), | ||
static_cast<std::size_t>(2)); | ||
|
||
auto policy2 = | ||
hpx::parallel::execution::with_processing_units_count(policy, 2); | ||
HPX_TEST_EQ(hpx::parallel::execution::processing_units_count( | ||
hpx::execution::par.parameters(), policy2.executor(), | ||
hpx::chrono::null_duration, 0), | ||
static_cast<std::size_t>(2)); | ||
|
||
return hpx::local::finalize(); | ||
} | ||
|
||
int main(int argc, char* argv[]) | ||
{ | ||
HPX_TEST_EQ_MSG(hpx::local::init(hpx_main, argc, argv), 0, | ||
"HPX main exited with non-zero status"); | ||
|
||
return hpx::util::report_errors(); | ||
} |
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
Oops, something went wrong.