@@ -129,18 +129,18 @@ namespace hpx::parallel::util::detail {
129129 typename Stride = std::size_t >
130130 hpx::util::iterator_range<chunk_size_iterator<IterOrR>>
131131 get_bulk_iteration_shape (ExPolicy& policy, IterOrR& it_or_r,
132- std::size_t & count, Stride s = Stride(1 ))
132+ std::size_t & count, std:: size_t & cores, Stride s = Stride(1 ))
133133 {
134134 if (count == 0 )
135135 {
136+ cores = 1 ;
136137 auto it = chunk_size_iterator (it_or_r, 1 );
137138 return hpx::util::iterator_range (it, it);
138139 }
139140
140- std::size_t const cores =
141- hpx::execution::experimental::processing_units_count (
142- policy.parameters (), policy.executor (),
143- hpx::chrono::null_duration, count);
141+ cores = hpx::execution::experimental::processing_units_count (
142+ policy.parameters (), policy.executor (), hpx::chrono::null_duration,
143+ count);
144144
145145 std::size_t max_chunks =
146146 hpx::execution::experimental::maximal_number_of_chunks (
@@ -183,10 +183,12 @@ namespace hpx::parallel::util::detail {
183183 typename IterOrR, typename Stride = std::size_t >
184184 hpx::util::iterator_range<chunk_size_iterator<IterOrR>>
185185 get_bulk_iteration_shape (ExPolicy& policy, std::vector<Future>& workitems,
186- F1&& f1, IterOrR& it_or_r, std::size_t & count, Stride s = Stride(1 ))
186+ F1&& f1, IterOrR& it_or_r, std::size_t & count, std::size_t & cores,
187+ Stride s = Stride(1 ))
187188 {
188189 if (count == 0 )
189190 {
191+ cores = 1 ;
190192 auto it = chunk_size_iterator (it_or_r, 1 );
191193 return hpx::util::iterator_range (it, it);
192194 }
@@ -219,10 +221,8 @@ namespace hpx::parallel::util::detail {
219221 hpx::execution::experimental::measure_iteration (
220222 policy.parameters (), policy.executor (), test_function, count);
221223
222- std::size_t const cores =
223- hpx::execution::experimental::processing_units_count (
224- policy.parameters (), policy.executor (), iteration_duration,
225- count);
224+ cores = hpx::execution::experimental::processing_units_count (
225+ policy.parameters (), policy.executor (), iteration_duration, count);
226226
227227 std::size_t max_chunks =
228228 hpx::execution::experimental::maximal_number_of_chunks (
@@ -264,20 +264,20 @@ namespace hpx::parallel::util::detail {
264264 typename Stride = std::size_t >
265265 std::vector<hpx::tuple<IterOrR, std::size_t >>
266266 get_bulk_iteration_shape_variable (ExPolicy& policy, IterOrR& it_or_r,
267- std::size_t & count, Stride s = Stride(1 ))
267+ std::size_t & count, std:: size_t & cores, Stride s = Stride(1 ))
268268 {
269269 using tuple_type = hpx::tuple<IterOrR, std::size_t >;
270270 std::vector<tuple_type> shape;
271271
272272 if (count == 0 )
273273 {
274+ cores = 1 ;
274275 return shape;
275276 }
276277
277- std::size_t const cores =
278- hpx::execution::experimental::processing_units_count (
279- policy.parameters (), policy.executor (),
280- hpx::chrono::null_duration, count);
278+ cores = hpx::execution::experimental::processing_units_count (
279+ policy.parameters (), policy.executor (), hpx::chrono::null_duration,
280+ count);
281281
282282 std::size_t max_chunks =
283283 hpx::execution::experimental::maximal_number_of_chunks (
@@ -338,20 +338,20 @@ namespace hpx::parallel::util::detail {
338338 typename FwdIter, typename Stride = std::size_t >
339339 decltype (auto ) get_bulk_iteration_shape(std::false_type, ExPolicy& policy,
340340 std::vector<Future>& workitems, F1&& f1, FwdIter& begin,
341- std::size_t & count, Stride s = Stride(1 ))
341+ std::size_t & count, std:: size_t & cores, Stride s = Stride(1 ))
342342 {
343343 return get_bulk_iteration_shape (
344- policy, workitems, HPX_FORWARD (F1, f1), begin, count, s);
344+ policy, workitems, HPX_FORWARD (F1, f1), begin, count, cores, s);
345345 }
346346
347347 HPX_CXX_EXPORT template <typename ExPolicy, typename Future, typename F1,
348348 typename FwdIter, typename Stride = std::size_t >
349349 decltype (auto ) get_bulk_iteration_shape(std::true_type, ExPolicy& policy,
350350 std::vector<Future>& workitems, F1&& f1, FwdIter& begin,
351- std::size_t & count, Stride s = Stride(1 ))
351+ std::size_t & count, std:: size_t & cores, Stride s = Stride(1 ))
352352 {
353353 return get_bulk_iteration_shape_variable (
354- policy, workitems, HPX_FORWARD (F1, f1), begin, count, s);
354+ policy, workitems, HPX_FORWARD (F1, f1), begin, count, cores, s);
355355 }
356356
357357 // /////////////////////////////////////////////////////////////////////////
@@ -384,21 +384,21 @@ namespace hpx::parallel::util::detail {
384384 hpx::util::iterator_range<
385385 parallel::util::detail::chunk_size_idx_iterator<FwdIter>>
386386 get_bulk_iteration_shape_idx (ExPolicy& policy, FwdIter begin,
387- std::size_t count, Stride s = Stride(1 ))
387+ std::size_t count, std:: size_t & cores, Stride s = Stride(1 ))
388388 {
389389 using iterator =
390390 parallel::util::detail::chunk_size_idx_iterator<FwdIter>;
391391
392392 if (count == 0 )
393393 {
394+ cores = 1 ;
394395 auto it = iterator (begin, 1 );
395396 return hpx::util::iterator_range (it, it);
396397 }
397398
398- std::size_t const cores =
399- hpx::execution::experimental::processing_units_count (
400- policy.parameters (), policy.executor (),
401- hpx::chrono::null_duration, count);
399+ cores = hpx::execution::experimental::processing_units_count (
400+ policy.parameters (), policy.executor (), hpx::chrono::null_duration,
401+ count);
402402
403403 std::size_t max_chunks =
404404 hpx::execution::experimental::maximal_number_of_chunks (
@@ -447,13 +447,14 @@ namespace hpx::parallel::util::detail {
447447 parallel::util::detail::chunk_size_idx_iterator<FwdIter>>
448448 get_bulk_iteration_shape_idx (ExPolicy& policy,
449449 std::vector<Future>& workitems, F1&& f1, FwdIter begin,
450- std::size_t count, Stride s = Stride(1 ))
450+ std::size_t count, std:: size_t & cores, Stride s = Stride(1 ))
451451 {
452452 using iterator =
453453 parallel::util::detail::chunk_size_idx_iterator<FwdIter>;
454454
455455 if (count == 0 )
456456 {
457+ cores = 1 ;
457458 auto it = iterator (begin, 1 );
458459 return hpx::util::iterator_range (it, it);
459460 }
@@ -488,10 +489,8 @@ namespace hpx::parallel::util::detail {
488489 hpx::execution::experimental::measure_iteration (
489490 policy.parameters (), policy.executor (), test_function, count);
490491
491- std::size_t const cores =
492- hpx::execution::experimental::processing_units_count (
493- policy.parameters (), policy.executor (), iteration_duration,
494- count);
492+ cores = hpx::execution::experimental::processing_units_count (
493+ policy.parameters (), policy.executor (), iteration_duration, count);
495494
496495 std::size_t max_chunks =
497496 hpx::execution::experimental::maximal_number_of_chunks (
@@ -536,20 +535,20 @@ namespace hpx::parallel::util::detail {
536535 typename Stride = std::size_t >
537536 std::vector<hpx::tuple<FwdIter, std::size_t , std::size_t >>
538537 get_bulk_iteration_shape_idx_variable (ExPolicy& policy, FwdIter first,
539- std::size_t count, Stride s = Stride(1 ))
538+ std::size_t count, std:: size_t & cores, Stride s = Stride(1 ))
540539 {
541540 using tuple_type = hpx::tuple<FwdIter, std::size_t , std::size_t >;
542541 std::vector<tuple_type> shape;
543542
544543 if (count == 0 )
545544 {
545+ cores = 1 ;
546546 return shape;
547547 }
548548
549- std::size_t const cores =
550- hpx::execution::experimental::processing_units_count (
551- policy.parameters (), policy.executor (),
552- hpx::chrono::null_duration, count);
549+ cores = hpx::execution::experimental::processing_units_count (
550+ policy.parameters (), policy.executor (), hpx::chrono::null_duration,
551+ count);
553552
554553 std::size_t max_chunks =
555554 hpx::execution::experimental::maximal_number_of_chunks (
0 commit comments