@@ -28,21 +28,21 @@ namespace cuopt::linear_programming {
2828
2929template <typename i_t , typename f_t >
3030static dual_simplex::user_problem_t <i_t , f_t > cuopt_problem_to_simplex_problem (
31- detail::problem_t <i_t , f_t >& model)
31+ raft:: handle_t const * handle_ptr, detail::problem_t <i_t , f_t >& model)
3232{
33- dual_simplex::user_problem_t <i_t , f_t > user_problem (model. handle_ptr );
33+ dual_simplex::user_problem_t <i_t , f_t > user_problem (handle_ptr);
3434
3535 int m = model.n_constraints ;
3636 int n = model.n_variables ;
3737 int nz = model.nnz ;
3838 user_problem.num_rows = m;
3939 user_problem.num_cols = n;
40- user_problem.objective = cuopt::host_copy (model.objective_coefficients );
40+ user_problem.objective = cuopt::host_copy (model.objective_coefficients , handle_ptr-> get_stream () );
4141
4242 dual_simplex::csr_matrix_t <i_t , f_t > csr_A (m, n, nz);
43- csr_A.x = cuopt::host_copy (model.coefficients );
44- csr_A.j = cuopt::host_copy (model.variables );
45- csr_A.row_start = cuopt::host_copy (model.offsets );
43+ csr_A.x = cuopt::host_copy (model.coefficients , handle_ptr-> get_stream () );
44+ csr_A.j = cuopt::host_copy (model.variables , handle_ptr-> get_stream () );
45+ csr_A.row_start = cuopt::host_copy (model.offsets , handle_ptr-> get_stream () );
4646
4747 csr_A.to_compressed_col (user_problem.A );
4848
@@ -51,8 +51,10 @@ static dual_simplex::user_problem_t<i_t, f_t> cuopt_problem_to_simplex_problem(
5151 user_problem.range_rows .clear ();
5252 user_problem.range_value .clear ();
5353
54- auto model_constraint_lower_bounds = cuopt::host_copy (model.constraint_lower_bounds );
55- auto model_constraint_upper_bounds = cuopt::host_copy (model.constraint_upper_bounds );
54+ auto model_constraint_lower_bounds =
55+ cuopt::host_copy (model.constraint_lower_bounds , handle_ptr->get_stream ());
56+ auto model_constraint_upper_bounds =
57+ cuopt::host_copy (model.constraint_upper_bounds , handle_ptr->get_stream ());
5658
5759 // All constraints have lower and upper bounds
5860 // lr <= a_i^T x <= ur
@@ -79,7 +81,7 @@ static dual_simplex::user_problem_t<i_t, f_t> cuopt_problem_to_simplex_problem(
7981 }
8082 user_problem.num_range_rows = user_problem.range_rows .size ();
8183 std::tie (user_problem.lower , user_problem.upper ) =
82- extract_host_bounds<f_t >(model.variable_bounds , model. handle_ptr );
84+ extract_host_bounds<f_t >(model.variable_bounds , handle_ptr);
8385 user_problem.problem_name = model.original_problem_ptr ->get_problem_name ();
8486 if (model.row_names .size () > 0 ) {
8587 user_problem.row_names .resize (m);
@@ -97,7 +99,7 @@ static dual_simplex::user_problem_t<i_t, f_t> cuopt_problem_to_simplex_problem(
9799 user_problem.obj_scale = model.presolve_data .objective_scaling_factor ;
98100 user_problem.var_types .resize (n);
99101
100- auto model_variable_types = cuopt::host_copy (model.variable_types );
102+ auto model_variable_types = cuopt::host_copy (model.variable_types , handle_ptr-> get_stream () );
101103 for (int j = 0 ; j < n; ++j) {
102104 user_problem.var_types [j] =
103105 model_variable_types[j] == var_t ::CONTINUOUS
0 commit comments