Skip to content

Commit 2175af8

Browse files
committed
Use default fork-join executor for memory touching
1 parent 312208b commit 2175af8

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

thrust/thrust/system/hpx/memory_resource.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
#endif // no system header
3232
#include <thrust/mr/fancy_pointer_resource.h>
3333
#include <thrust/mr/new.h>
34+
#include <thrust/system/hpx/detail/runtime.h>
3435
#include <thrust/system/hpx/pointer.h>
3536

3637
#include <hpx/parallel/algorithms/for_loop.hpp>
@@ -54,9 +55,10 @@ class topology_resource final : public mr::memory_resource<>
5455

5556
// touch first byte of every page
5657
const auto page_size = ::hpx::threads::get_memory_page_size();
57-
::hpx::experimental::for_loop_strided(::hpx::execution::par, ptr, ptr + bytes, page_size, [](std::byte* it) {
58-
*it = {};
59-
});
58+
::hpx::experimental::for_loop_strided(
59+
::hpx::execution::par.on(runtime.default_executor), ptr, ptr + bytes, page_size, [](std::byte* it) {
60+
*it = {};
61+
});
6062

6163
return ptr;
6264
}

0 commit comments

Comments
 (0)