Skip to content

Commit c3bc13c

Browse files
Merge branch 'main' into gtest-static
2 parents 5351bb2 + 716700b commit c3bc13c

File tree

24 files changed

+144
-94
lines changed

24 files changed

+144
-94
lines changed

conda/environments/all_cuda-129_arch-aarch64.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ dependencies:
4242
- myst-parser
4343
- ninja
4444
- notebook
45-
- numba-cuda>=0.19.1,<0.20.0a0
45+
- numba-cuda>=0.22.1,<0.23.0
4646
- numba>=0.60.0
4747
- numpy>=1.23.5,<3.0a0
4848
- numpydoc

conda/environments/all_cuda-129_arch-x86_64.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ dependencies:
4242
- myst-parser
4343
- ninja
4444
- notebook
45-
- numba-cuda>=0.19.1,<0.20.0a0
45+
- numba-cuda>=0.22.1,<0.23.0
4646
- numba>=0.60.0
4747
- numpy>=1.23.5,<3.0a0
4848
- numpydoc

conda/environments/all_cuda-130_arch-aarch64.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ dependencies:
4242
- myst-parser
4343
- ninja
4444
- notebook
45-
- numba-cuda>=0.19.1,<0.20.0a0
45+
- numba-cuda>=0.22.1,<0.23.0
4646
- numba>=0.60.0
4747
- numpy>=1.23.5,<3.0a0
4848
- numpydoc

conda/environments/all_cuda-130_arch-x86_64.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ dependencies:
4242
- myst-parser
4343
- ninja
4444
- notebook
45-
- numba-cuda>=0.19.1,<0.20.0a0
45+
- numba-cuda>=0.22.1,<0.23.0
4646
- numba>=0.60.0
4747
- numpy>=1.23.5,<3.0a0
4848
- numpydoc

conda/recipes/cuopt/recipe.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ requirements:
7777
- h5py
7878
- libcuopt =${{ version }}
7979
- numba >=0.60.0
80-
- numba-cuda>=0.19.1,<0.20.0a0
80+
- numba-cuda>=0.22.1,<0.23.0
8181
- numpy >=1.23,<3.0a0
8282
- pandas >=2.0
8383
- pylibraft =${{ minor_version }}

cpp/src/linear_programming/utilities/problem_checking.cu

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,8 @@ void problem_checking_t<i_t, f_t>::check_csr_representation(
4545
cuopt_expects(thrust::all_of(op_problem.get_handle_ptr()->get_thrust_policy(),
4646
op_problem.get_constraint_matrix_indices().cbegin(),
4747
op_problem.get_constraint_matrix_indices().cend(),
48-
[n_variables = op_problem.get_n_variables()] __device__(i_t val) {
49-
return val >= 0 && val < n_variables;
50-
}),
48+
[n_variables = op_problem.get_n_variables()] __device__(
49+
i_t val) -> bool { return val >= 0 && val < n_variables; }),
5150
error_type_t::ValidationError,
5251
"A_indices values must positive lower than the number of variables (c size).");
5352
}
@@ -72,7 +71,7 @@ void problem_checking_t<i_t, f_t>::check_initial_primal_representation(
7271
[lower_bounds = make_span(op_problem.get_variable_lower_bounds()),
7372
upper_bounds = make_span(op_problem.get_variable_upper_bounds()),
7473
assignment_span = make_span(primal_initial_solution),
75-
int_tol = 1e-8] __device__(i_t idx) {
74+
int_tol = 1e-8] __device__(i_t idx) -> bool {
7675
return assignment_span[idx] < lower_bounds[idx] - int_tol ||
7776
assignment_span[idx] > upper_bounds[idx] + int_tol;
7877
}),
@@ -171,13 +170,14 @@ void problem_checking_t<i_t, f_t>::check_problem_representation(
171170

172171
// Check row type if set
173172
if (!op_problem.get_row_types().is_empty()) {
174-
cuopt_expects(
175-
thrust::all_of(op_problem.get_handle_ptr()->get_thrust_policy(),
176-
op_problem.get_row_types().cbegin(),
177-
op_problem.get_row_types().cend(),
178-
[] __device__(char val) { return val == 'E' || val == 'G' || val == 'L'; }),
179-
error_type_t::ValidationError,
180-
"row_types values must equal to 'E', 'G' or 'L'.");
173+
cuopt_expects(thrust::all_of(op_problem.get_handle_ptr()->get_thrust_policy(),
174+
op_problem.get_row_types().cbegin(),
175+
op_problem.get_row_types().cend(),
176+
[] __device__(char val) -> bool {
177+
return val == 'E' || val == 'G' || val == 'L';
178+
}),
179+
error_type_t::ValidationError,
180+
"row_types values must equal to 'E', 'G' or 'L'.");
181181

182182
cuopt_expects(
183183
op_problem.get_row_types().size() == op_problem.get_constraint_bounds().size(),
@@ -322,19 +322,17 @@ bool problem_checking_t<i_t, f_t>::has_crossing_bounds(
322322
thrust::make_counting_iterator(0),
323323
thrust::make_counting_iterator(0) + op_problem.get_variable_upper_bounds().size(),
324324
[upper_bounds = make_span(op_problem.get_variable_upper_bounds()),
325-
lower_bounds = make_span(op_problem.get_variable_lower_bounds())] __device__(size_t i) {
326-
return upper_bounds[i] >= lower_bounds[i];
327-
});
325+
lower_bounds = make_span(op_problem.get_variable_lower_bounds())] __device__(size_t i)
326+
-> bool { return upper_bounds[i] >= lower_bounds[i]; });
328327

329328
// Check if all constraint bounds are valid (upper >= lower)
330329
bool all_constraint_bounds_valid = thrust::all_of(
331330
op_problem.get_handle_ptr()->get_thrust_policy(),
332331
thrust::make_counting_iterator(0),
333332
thrust::make_counting_iterator(0) + op_problem.get_constraint_upper_bounds().size(),
334333
[upper_bounds = make_span(op_problem.get_constraint_upper_bounds()),
335-
lower_bounds = make_span(op_problem.get_constraint_lower_bounds())] __device__(size_t i) {
336-
return upper_bounds[i] >= lower_bounds[i];
337-
});
334+
lower_bounds = make_span(op_problem.get_constraint_lower_bounds())] __device__(size_t i)
335+
-> bool { return upper_bounds[i] >= lower_bounds[i]; });
338336

339337
// Return true if any bounds are invalid (crossing)
340338
return !all_variable_bounds_valid || !all_constraint_bounds_valid;

cpp/src/mip/diversity/recombiners/bound_prop_recombiner.cuh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
#include "recombiner.cuh"
1111

12+
#include <thrust/pair.h>
1213
#include <mip/local_search/rounding/constraint_prop.cuh>
1314
#include <mip/relaxed_lp/relaxed_lp.cuh>
1415
#include <mip/solution/solution.cuh>

cpp/src/mip/feasibility_jump/utils.cuh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
#include "feasibility_jump.cuh"
1111

12+
#include <thrust/pair.h>
1213
#include <cuda/atomic>
1314
#include <raft/core/device_span.hpp>
1415
#include <rmm/device_scalar.hpp>

cpp/src/mip/local_search/rounding/bounds_repair.cu

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ void bounds_repair_t<i_t, f_t>::compute_damages(problem_t<i_t, f_t>& problem, i_
268268
sort_iterator + n_candidates,
269269
thrust::make_zip_iterator(thrust::make_tuple(
270270
candidates.bound_shift.data(), candidates.variable_index.data())),
271-
[] __device__(auto tuple1, auto tuple2) {
271+
[] __device__(auto tuple1, auto tuple2) -> bool {
272272
if (thrust::get<0>(tuple1) < thrust::get<0>(tuple2)) {
273273
return true;
274274
} else if (thrust::get<0>(tuple1) == thrust::get<0>(tuple2) &&
@@ -291,7 +291,7 @@ i_t bounds_repair_t<i_t, f_t>::find_cutoff_index(const candidates_t<i_t, f_t>& c
291291
handle_ptr->get_thrust_policy(),
292292
iterator,
293293
iterator + n_candidates,
294-
[best_cstr_delta, best_damage] __device__(auto tuple) {
294+
[best_cstr_delta, best_damage] __device__(auto tuple) -> bool {
295295
if (thrust::get<0>(tuple) == best_cstr_delta && thrust::get<1>(tuple) <= best_damage) {
296296
return true;
297297
}

cpp/src/mip/local_search/rounding/constraint_prop.cuh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
#pragma once
99

10+
#include <thrust/pair.h>
1011
#include <mip/local_search/rounding/bounds_repair.cuh>
1112
#include <mip/presolve/bounds_presolve.cuh>
1213
#include <mip/presolve/conditional_bound_strengthening.cuh>

0 commit comments

Comments
 (0)