-
Notifications
You must be signed in to change notification settings - Fork 217
refactor(tests): link internal tests against cuopt_static #1581
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
20ad11d
de93a4d
e6589c1
a59bd8c
bd27745
0e5689a
90e5d79
3e58684
c9476b2
1f52c5e
545ce45
0effbce
755ec5d
8f23153
c159896
3a55206
5ec9425
57cd958
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| # cmake-format: off | ||
| # SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| # cmake-format: on | ||
|
|
||
| # Single binary for all numopt tests that require internal symbols (cuopt_static). | ||
| # Add new internal numopt tests here instead of creating separate STATIC_LIB targets. | ||
| ConfigureTest(NUMOPT_INTERNAL_TEST | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is there a reason we are creating one giant binary? It kind of removes the isolation of test that belong to different functional parts of the solver. This increases link time as well. It might also create name collusions on which you have encountered some of them and fixed with static functions. Also now when we want to run a test, it is more cumbersome with |
||
| ${CUOPT_TEST_DIR}/internal/main.cu | ||
| # dual_simplex | ||
| ${CUOPT_TEST_DIR}/dual_simplex/unit_tests/solve.cpp | ||
| ${CUOPT_TEST_DIR}/dual_simplex/unit_tests/solve_barrier.cu | ||
| ${CUOPT_TEST_DIR}/dual_simplex/unit_tests/right_looking_ldlt.cpp | ||
| # linear_programming | ||
| ${CUOPT_TEST_DIR}/linear_programming/pdlp_test.cu | ||
| ${CUOPT_TEST_DIR}/linear_programming/unit_tests/optimization_problem_test.cu | ||
| ${CUOPT_TEST_DIR}/linear_programming/unit_tests/presolve_test.cu | ||
| ${CUOPT_TEST_DIR}/linear_programming/parser_test.cpp | ||
| # mip | ||
| ${CUOPT_TEST_DIR}/mip/miplib_test.cu | ||
| ${CUOPT_TEST_DIR}/mip/problem_test.cu | ||
| ${CUOPT_TEST_DIR}/mip/elim_var_remap_test.cu | ||
| ${CUOPT_TEST_DIR}/mip/bounds_standardization_test.cu | ||
| ${CUOPT_TEST_DIR}/mip/multi_probe_test.cu | ||
| ${CUOPT_TEST_DIR}/mip/cuts_test.cu | ||
| ${CUOPT_TEST_DIR}/mip/unit_test.cu | ||
| ${CUOPT_TEST_DIR}/mip/integer_with_real_bounds.cu | ||
| ${CUOPT_TEST_DIR}/mip/empty_fixed_problems_test.cu | ||
| ${CUOPT_TEST_DIR}/mip/presolve_test.cu | ||
| ${CUOPT_TEST_DIR}/mip/termination_test.cu | ||
| ${CUOPT_TEST_DIR}/mip/determinism_test.cu | ||
| # socp | ||
| ${CUOPT_TEST_DIR}/socp/second_order_cone_kernels.cu | ||
| ${CUOPT_TEST_DIR}/socp/solve_barrier_socp.cu | ||
| ${CUOPT_TEST_DIR}/socp/general_quadratic_test.cu | ||
| LABELS numopt | ||
| STATIC_LIB) | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| /* clang-format off */ | ||
| /* | ||
| * SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
| /* clang-format on */ | ||
|
|
||
| #include <utilities/base_fixture.hpp> | ||
|
|
||
| int main(int argc, char** argv) | ||
| { | ||
| ::testing::InitGoogleTest(&argc, argv); | ||
| auto const cmd_opts = parse_test_options(argc, argv); | ||
| auto const rmm_mode = cmd_opts["rmm_mode"].as<std::string>(); | ||
| auto resource = cuopt::test::create_memory_resource(rmm_mode); | ||
| rmm::mr::set_current_device_resource(resource); | ||
| return RUN_ALL_TESTS(); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is needed for the compilation and internal objects(Your compilation already fails because of this). OpenMP is also needed IMO.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in commits
8f23153c(OpenMP::OpenMP_CUDA) andc1598967(simde::simde). Both were PRIVATE deps of the oldcuoptSHARED target that were providing compile-time flags/includes; after the refactor tocuopt_objs, they need to be on the OBJECT library where sources are actually compiled.