Skip to content

Commit

Permalink
Merge pull request #1141 from vasama/msvc-warn
Browse files Browse the repository at this point in the history
Clean up MSVC warnings
  • Loading branch information
ericniebler authored Nov 16, 2023
2 parents d3ea06d + 5aad30f commit 49cec0b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,8 @@ target_compile_options(stdexec_executable_flags INTERFACE
# Silence warnings
target_compile_options(stdexec_executable_flags INTERFACE
$<$<CXX_COMPILER_ID:GNU>:-Wno-non-template-friend>
$<$<CXX_COMPILER_ID:NVHPC>:--diag_suppress177,550,111,497,554>)
$<$<CXX_COMPILER_ID:NVHPC>:--diag_suppress177,550,111,497,554>
$<$<CXX_COMPILER_ID:MSVC>:/wd4100 /wd4101 /wd4127 /wd4324 /wd4456 /wd4459>)

# Template backtrace limit
target_compile_options(stdexec_executable_flags INTERFACE
Expand Down
8 changes: 4 additions & 4 deletions include/exec/static_thread_pool.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -626,8 +626,8 @@ namespace exec {
++idx;
}
remote_queue* correct_queue = this_id == queue.id_ ? &queue : get_remote_queue();
std::size_t nThreads = available_parallelism();
for (std::size_t i = 0; i < nThreads; ++i) {
std::uint32_t nThreads = available_parallelism();
for (std::uint32_t i = 0; i < nThreads; ++i) {
auto [i0, iEnd] = even_share(nTasks, i, available_parallelism());
if (i0 == iEnd) {
continue;
Expand Down Expand Up @@ -676,8 +676,8 @@ namespace exec {
if (victims_.empty()) {
return {nullptr, index_};
}
std::uniform_int_distribution<std::uint32_t> dist(0, victims_.size() - 1);
std::uint32_t victimIndex = dist(rng_);
std::uniform_int_distribution<std::size_t> dist(0, victims_.size() - 1);
std::size_t victimIndex = dist(rng_);
auto& v = victims_[victimIndex];
return {v.try_steal(), v.index()};
}
Expand Down

0 comments on commit 49cec0b

Please sign in to comment.