diff --git a/thrust/thrust/system/hpx/memory_resource.h b/thrust/thrust/system/hpx/memory_resource.h index d7dc43e9014..91e5f0897ab 100644 --- a/thrust/thrust/system/hpx/memory_resource.h +++ b/thrust/thrust/system/hpx/memory_resource.h @@ -33,8 +33,6 @@ #include #include -#include - THRUST_NAMESPACE_BEGIN namespace system { @@ -50,15 +48,7 @@ class topology_resource final : public mr::memory_resource<> public: void* do_allocate(std::size_t bytes, std::size_t /*alignment*/ = THRUST_MR_DEFAULT_ALIGNMENT) override { - std::byte* ptr = static_cast(::hpx::threads::create_topology().allocate(bytes)); - - // touch first byte of every page - const auto page_size = ::hpx::threads::get_memory_page_size(); - ::hpx::experimental::for_loop_strided(::hpx::execution::par, ptr, ptr + bytes, page_size, [](std::byte* it) { - *it = {}; - }); - - return ptr; + return ::hpx::threads::create_topology().allocate(bytes); } void do_deallocate(void* p, std::size_t bytes, std::size_t /*alignment*/ = THRUST_MR_DEFAULT_ALIGNMENT) override