11/* *
2- * Copyright 2024-2025 , XGBoost Contributors
2+ * Copyright 2024-2026 , XGBoost Contributors
33 */
44#if defined(__linux__)
55
@@ -25,15 +25,17 @@ class TestCudaGrowOnly : public ::testing::TestWithParam<std::size_t> {
2525 thrust::sequence (ctx.CUDACtx ()->CTP (), ref.begin (), ref.end (), 0.0 );
2626 auto res = std::dynamic_pointer_cast<common::CudaGrowOnlyResource>(ref.Resource ());
2727 CHECK (res);
28- res->Resize (n * sizeof (double ));
28+ res->Resize (n * sizeof (double ), ctx. CUDACtx ()-> Stream () );
2929
3030 auto ref1 = RefResourceView<double >(res->DataAs <double >(), res->Size () / sizeof (double ),
3131 ref.Resource ());
3232 ASSERT_EQ (res->Size (), n * sizeof (double ));
3333 ASSERT_EQ (ref1.size (), n);
3434 thrust::sequence (ctx.CUDACtx ()->CTP (), ref1.begin (), ref1.end (), static_cast <double >(0.0 ));
3535 std::vector<double > h_vec (ref1.size ());
36- dh::safe_cuda (cudaMemcpyAsync (h_vec.data (), ref1.data (), ref1.size_bytes (), cudaMemcpyDefault));
36+ dh::safe_cuda (cudaMemcpyAsync (h_vec.data (), ref1.data (), ref1.size_bytes (), cudaMemcpyDefault,
37+ ctx.CUDACtx ()->Stream ()));
38+ ctx.CUDACtx ()->Stream ().Sync ();
3739 for (std::size_t i = 0 ; i < h_vec.size (); ++i) {
3840 ASSERT_EQ (h_vec[i], i);
3941 }
@@ -64,8 +66,7 @@ TEST(HostPinnedMemPool, Alloc) {
6466
6567 // Thread safety.
6668 auto n_threads = static_cast <std::int32_t >(std::thread::hardware_concurrency ());
67- common::ThreadPool workers{" tmempool" , n_threads, [] {
68- }};
69+ common::ThreadPool workers{" tmempool" , n_threads, [] {}};
6970 std::vector<std::future<RefResourceView<double >>> alloc_futs;
7071 for (std::int32_t i = 0 , n = n_threads * 4 ; i < n; ++i) {
7172 auto fut = workers.Submit ([i, pool] {
0 commit comments