Skip to content

Commit 91ef0d1

Browse files
committed
downlgrade cuda in ci; fix warnings; update scalable_ccd
1 parent b3edcb8 commit 91ef0d1

File tree

8 files changed

+23
-21
lines changed

8 files changed

+23
-21
lines changed

.github/workflows/cuda.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
- uses: Jimver/[email protected]
4141
id: cuda-toolkit
4242
with:
43-
cuda: '12.5.0'
43+
cuda: '12.3.2'
4444

4545
- name: Get number of CPU cores
4646
uses: SimenB/[email protected]

cmake/recipes/scalable_ccd.cmake

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ message(STATUS "Third-party: creating target 'scalable_ccd::scalable_ccd'")
99
set(SCALABLE_CCD_WITH_CUDA ${IPC_TOOLKIT_WITH_CUDA} CACHE BOOL "Enable CUDA CCD" FORCE)
1010

1111
include(CPM)
12-
CPMAddPackage("gh:continuous-collision-detection/scalable-ccd#318352e6aa3c1008a67c80547c6fa21bf18fb1a5")
12+
CPMAddPackage("gh:continuous-collision-detection/scalable-ccd#95a078bbaf9659f2e1b4285d51475deff163bfa0")

src/ipc/ccd/additive_ccd.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ namespace {
6060
}
6161
} // namespace
6262

63-
AdditiveCCD::AdditiveCCD(const double conservative_rescaling)
64-
: conservative_rescaling(conservative_rescaling)
63+
AdditiveCCD::AdditiveCCD(const double _conservative_rescaling)
64+
: conservative_rescaling(_conservative_rescaling)
6565
{
6666
}
6767

src/ipc/ccd/tight_inclusion_ccd.cpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@ static constexpr double INITIAL_DISTANCE_TOLERANCE_SCALE = 0.5;
2121
static constexpr long TIGHT_INCLUSION_UNLIMITED_ITERATIONS = -1;
2222

2323
TightInclusionCCD::TightInclusionCCD(
24-
const double tolerance,
25-
const long max_iterations,
26-
const double conservative_rescaling)
27-
: tolerance(tolerance)
28-
, max_iterations(max_iterations)
29-
, conservative_rescaling(conservative_rescaling)
24+
const double _tolerance,
25+
const long _max_iterations,
26+
const double _conservative_rescaling)
27+
: tolerance(_tolerance)
28+
, max_iterations(_max_iterations)
29+
, conservative_rescaling(_conservative_rescaling)
3030
{
3131
}
3232

src/ipc/implicits/plane.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ double compute_point_plane_collision_free_stepsize(
100100
const double earliest_toi = tbb::parallel_reduce(
101101
tbb::blocked_range<size_t>(0, points_t0.rows()),
102102
/*inital_step_size=*/1.0,
103-
[&](tbb::blocked_range<size_t> r, double earliest_toi) {
103+
[&](tbb::blocked_range<size_t> r, double current_toi) {
104104
for (size_t vi = r.begin(); vi < r.end(); vi++) {
105105
for (size_t pi = 0; pi < n_planes; pi++) {
106106
if (!can_collide(vi, pi)) {
@@ -116,13 +116,13 @@ double compute_point_plane_collision_free_stepsize(
116116
plane_normal, toi);
117117

118118
if (are_colliding) {
119-
if (toi < earliest_toi) {
120-
earliest_toi = toi;
119+
if (toi < current_toi) {
120+
current_toi = toi;
121121
}
122122
}
123123
}
124124
}
125-
return earliest_toi;
125+
return current_toi;
126126
},
127127
[&](double a, double b) { return std::min(a, b); });
128128

src/ipc/ipc.cpp

+4-2
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,10 @@ double compute_collision_free_stepsize(
5656
"Sweep and Tiniest Queue is only supported in 3D!");
5757
}
5858
// TODO: Use correct min_distance
59-
const double tolerance = TightInclusionCCD::DEFAULT_TOLERANCE;
60-
const long max_iterations = TightInclusionCCD::DEFAULT_MAX_ITERATIONS;
59+
// TODO: Expose tolerance and max_iterations
60+
constexpr double tolerance = TightInclusionCCD::DEFAULT_TOLERANCE;
61+
constexpr long max_iterations =
62+
TightInclusionCCD::DEFAULT_MAX_ITERATIONS;
6163
const double step_size = scalable_ccd::cuda::ipc_ccd_strategy(
6264
vertices_t0, vertices_t1, mesh.edges(), mesh.faces(),
6365
/*min_distance=*/0.0, max_iterations, tolerance);

tests/src/tests/barrier/test_barrier.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ class NormalizedClampedLogBarrier : public ipc::Barrier {
5959
/// @warning This implementation will not work with dmin > 0
6060
class PhysicalBarrier : public ipc::NormalizedClampedLogBarrier {
6161
public:
62-
PhysicalBarrier(const bool use_dist_sqr) : use_dist_sqr(use_dist_sqr) { }
62+
PhysicalBarrier(const bool _use_dist_sqr) : use_dist_sqr(_use_dist_sqr) { }
6363

6464
double operator()(const double d, const double dhat) const override
6565
{

tests/src/tests/ccd/test_gpu_ccd.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,15 @@ TEST_CASE("GPU CCD", "[ccd][gpu]")
4343
const double min_distance = 0;
4444

4545
const double toi_cpu = compute_collision_free_stepsize(
46-
mesh, V0, V1, BroadPhaseMethod::SWEEP_AND_PRUNE, min_distance,
47-
tolerance, max_iterations);
46+
mesh, V0, V1, min_distance, BroadPhaseMethod::SWEEP_AND_PRUNE,
47+
TightInclusionCCD(tolerance, max_iterations));
4848

4949
// Got this value from running the code
5050
CHECK(toi_cpu == Catch::Approx(4.76837158203125000e-06));
5151

5252
const double toi_gpu = compute_collision_free_stepsize(
53-
mesh, V0, V1, BroadPhaseMethod::SWEEP_AND_TINIEST_QUEUE, min_distance,
54-
tolerance, max_iterations);
53+
mesh, V0, V1, min_distance, BroadPhaseMethod::SWEEP_AND_TINIEST_QUEUE,
54+
TightInclusionCCD(tolerance, max_iterations));
5555

5656
// Got this value from running the code
5757
CHECK(toi_gpu == Catch::Approx(3.05175781250000017e-6));

0 commit comments

Comments
 (0)