Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/ipc/broad_phase/lbvh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,13 +149,14 @@ void LBVH::init_bvh(
{
IPC_TOOLKIT_PROFILE_BLOCK("compute_morton_codes");

const Eigen::Array3d mesh_width = mesh_aabb.max - mesh_aabb.min;
const Eigen::Array3d mesh_width_inv =
1.0 / (mesh_aabb.max - mesh_aabb.min);
tbb::parallel_for(size_t(0), boxes.size(), [&](size_t i) {
const auto& box = boxes[i];

const Eigen::Array3d center = 0.5 * (box.min + box.max);
const Eigen::Array3d mapped_center =
(center - mesh_aabb.min) / mesh_width;
(center - mesh_aabb.min) * mesh_width_inv;

if (dim == 2) {
morton_codes[i].morton_code =
Expand Down
12 changes: 9 additions & 3 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,15 @@ if(IPC_TOOLKIT_WITH_CUDA)
# other libraries and executables.
set_target_properties(ipc_toolkit_tests PROPERTIES CUDA_SEPARABLE_COMPILATION ON)

# Use the same CUDA architectures Scalable CCD
# get_target_property(CMAKE_CUDA_ARCHITECTURES scalable_ccd CUDA_ARCHITECTURES)
set_target_properties(ipc_toolkit_tests PROPERTIES CUDA_ARCHITECTURES "native")
# Use the CUDA architectures specified by the user (e.g. via
# -DCMAKE_CUDA_ARCHITECTURES) and only fall back to auto-detecting the local
# GPU ("native") when none were given. "native" requires a physical GPU, so
# the fallback fails in GPU-less environments such as CI/Docker builds.
if(DEFINED CMAKE_CUDA_ARCHITECTURES)
set_target_properties(ipc_toolkit_tests PROPERTIES CUDA_ARCHITECTURES "${CMAKE_CUDA_ARCHITECTURES}")
else()
set_target_properties(ipc_toolkit_tests PROPERTIES CUDA_ARCHITECTURES "native")
endif()
endif()

if (IPC_TOOLKIT_TESTS_CCD_BENCHMARK)
Expand Down
Loading