@@ -42,8 +42,11 @@ class routing_resource_t {
4242template <typename i_t , typename f_t , typename Solution, typename Problem>
4343class pool_allocator_t {
4444 public:
45- pool_allocator_t (const Problem& problem_, i_t n_solutions_, i_t desired_n_routes = -1 )
46- : stream_pool(n_solutions_), problem(problem_)
45+ pool_allocator_t (const Problem& problem_,
46+ i_t n_solutions_,
47+ rmm::cuda_stream_view stream_,
48+ i_t desired_n_routes = -1 )
49+ : problem(problem_), stream(stream_)
4750 {
4851 raft::common::nvtx::range fun_scope (" pool_allocator_t" );
4952 // FIXME:: This is temporary, we should let the diversity manager decide this
@@ -54,8 +57,7 @@ class pool_allocator_t {
5457 }
5558 sol_handles.reserve (n_solutions_);
5659 for (i_t i = 0 ; i < n_solutions_; ++i) {
57- sol_handles.emplace_back (
58- std::make_unique<solution_handle_t <i_t , f_t >>(stream_pool.get_stream (i)));
60+ sol_handles.emplace_back (std::make_unique<solution_handle_t <i_t , f_t >>(stream));
5961 }
6062 Solution dummy_sol{problem_, 0 , sol_handles[0 ].get ()};
6163 resource_pool =
@@ -70,9 +72,10 @@ class pool_allocator_t {
7072
7173 void sync_all_streams () const
7274 {
73- for (size_t i = 0 ; i < stream_pool.get_pool_size (); ++i) {
74- stream_pool.get_stream (i).synchronize ();
75- }
75+ // for (size_t i = 0; i < stream_pool.get_pool_size(); ++i) {
76+ // stream_pool.get_stream(i).synchronize();
77+ // }
78+ stream.synchronize ();
7679 }
7780
7881 // a stream pool that will be used to execute different solutions on
@@ -81,9 +84,10 @@ class pool_allocator_t {
8184 // however that pushes some internal logic to the higher levels which we want to avoid
8285 // rmm::cuda_stream_pool is non-movable as it contains an atomic variables
8386 // KEEP THIS MEMBER ABOVE OTHER MEMBERS, so that it is destructed the last
84- rmm::cuda_stream_pool stream_pool;
87+ // rmm::cuda_stream_pool stream_pool;
8588
8689 // problem description
90+ rmm::cuda_stream_view stream;
8791 const Problem& problem;
8892 std::vector<std::unique_ptr<solution_handle_t <i_t , f_t >>> sol_handles;
8993 // keep a thread safe pool of local search and ges objects that can be reused
0 commit comments