Skip to content

Commit

Permalink
feat: remove cuda support
Browse files Browse the repository at this point in the history
  • Loading branch information
sebcrozet committed Apr 28, 2024
1 parent 1616660 commit 57a472f
Show file tree
Hide file tree
Showing 63 changed files with 271 additions and 1,705 deletions.
26 changes: 26 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,31 @@
# Change Log

## Unreleased

### Modified

- Remove CUDA support to break free from the toolchain restriction required by cust.
- Rework internal edges resolution using normal cones. This implies the modification of the
`SimdCompositeShape::map_part_at`, `TypedSimdCompositeShape::map_typed_part`, and
`TypedSimdCompositeShape::map_untyped_part` trait functions so that the closure argument takes
an extra argument for the (optional) normal constraints. This argument can be safely ignored
by user code unless applying the normal collection is relevant to your use-case.
- Contact manifolds will now retain all contacts (including the ones further than the specified `prediction`
distance) whenever any contact is actually closer than this `prediction` distance.
- Typo fix: renamed `TopologyError::BadAdjascentTrianglesOrientation` to `BadAdjacentTrianglesOrientation`.

### Fixed

- Fix contacts between convex shapes being occasionally ignored due to some rounding errors.
- Remove crash when entering unreachable code in non-linear TOI calculation.
- Fix accuracy issue in triangle-mesh center-of-mass calculation when the mesh isn’t manifold.

### Added

- Add `SdpMatrix2::inverse_and_get_determinant_unchecked`. This is useful for computing the
inverse in a AoSoA SIMD setting.
- Add `Aabb::intersects_moving_aabb` to perform a swept test between two moving aabbs.

## v0.13.8
### Added

Expand Down
4 changes: 0 additions & 4 deletions crates/parry2d-f64/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ bytemuck-serialize = ["bytemuck", "nalgebra/convert-bytemuck"]
simd-stable = ["simba/wide", "simd-is-enabled"]
simd-nightly = ["simba/packed_simd", "simd-is-enabled"]
enhanced-determinism = ["simba/libm_force", "indexmap"]
cuda = ["cust_core", "cust", "nalgebra/cuda"]
parallel = ["rayon"]

# Do not enable this feature directly. It is automatically
Expand Down Expand Up @@ -62,9 +61,6 @@ rayon = { version = "1", optional = true }
bytemuck = { version = "1", features = ["derive"], optional = true }
log = "0.4"

[target.'cfg(not(target_os = "cuda"))'.dependencies]
cust = { version = "0.3", optional = true }

[dev-dependencies]
simba = { version = "0.8", default-features = false, features = ["partial_fixed_point_support"] }
oorandom = "11"
Expand Down
4 changes: 0 additions & 4 deletions crates/parry2d/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ bytemuck-serialize = ["bytemuck", "nalgebra/convert-bytemuck"]
simd-stable = ["simba/wide", "simd-is-enabled"]
simd-nightly = ["simba/packed_simd", "simd-is-enabled"]
enhanced-determinism = ["simba/libm_force", "indexmap"]
cuda = ["cust_core", "cust", "nalgebra/cuda"]
parallel = ["rayon"]

# Do not enable this feature directly. It is automatically
Expand Down Expand Up @@ -62,9 +61,6 @@ rayon = { version = "1", optional = true }
bytemuck = { version = "1", features = ["derive"], optional = true }
log = "0.4"

[target.'cfg(not(target_os = "cuda"))'.dependencies]
cust = { version = "0.3", optional = true }

[dev-dependencies]
simba = { version = "0.8", default-features = false, features = ["partial_fixed_point_support"] }
oorandom = "11"
Expand Down
10 changes: 9 additions & 1 deletion crates/parry2d/tests/geometry/epa2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,15 @@ fn cuboids_large_size_ratio_issue_181() {
let pos_ab = pos_a.inv_mul(&pos_b);
let mut manifold: ContactManifold<(), ()> = ContactManifold::new();
dispatcher
.contact_manifold_convex_convex(&pos_ab, &cuboid_a, &cuboid_b, 0.0, &mut manifold)
.contact_manifold_convex_convex(
&pos_ab,
&cuboid_a,
&cuboid_b,
None,
None,
0.0,
&mut manifold,
)
.unwrap();

if let Some(deepest) = manifold.find_deepest_contact() {
Expand Down
4 changes: 0 additions & 4 deletions crates/parry3d-f64/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ bytemuck-serialize = ["bytemuck", "nalgebra/convert-bytemuck"]
simd-stable = ["simba/wide", "simd-is-enabled"]
simd-nightly = ["simba/packed_simd", "simd-is-enabled"]
enhanced-determinism = ["simba/libm_force", "indexmap"]
cuda = ["cust_core", "cust", "nalgebra/cuda"]
parallel = ["rayon"]

# Do not enable this feature directly. It is automatically
Expand Down Expand Up @@ -62,9 +61,6 @@ rayon = { version = "1", optional = true }
bytemuck = { version = "1", features = ["derive"], optional = true }
log = "0.4"

[target.'cfg(not(target_os = "cuda"))'.dependencies]
cust = { version = "0.3", optional = true }

[dev-dependencies]
oorandom = "11"
ptree = "0.4.0"
Expand Down
4 changes: 0 additions & 4 deletions crates/parry3d/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ bytemuck-serialize = ["bytemuck", "nalgebra/convert-bytemuck"]
simd-stable = ["simba/wide", "simd-is-enabled"]
simd-nightly = ["simba/packed_simd", "simd-is-enabled"]
enhanced-determinism = ["simba/libm_force", "indexmap"]
cuda = ["cust_core", "cust", "nalgebra/cuda"]
parallel = ["rayon"]

# Do not enable this feature directly. It is automatically
Expand Down Expand Up @@ -63,9 +62,6 @@ rayon = { version = "1", optional = true }
bytemuck = { version = "1", features = ["derive"], optional = true }
log = "0.4"

[target.'cfg(not(target_os = "cuda"))'.dependencies]
cust = { version = "0.3", optional = true }

[dev-dependencies]
oorandom = "11"
ptree = "0.4.0"
Expand Down
1 change: 0 additions & 1 deletion src/bounding_volume/aabb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ use rkyv::{bytecheck, CheckBytes};
derive(rkyv::Archive, rkyv::Deserialize, rkyv::Serialize, CheckBytes),
archive(as = "Self")
)]
#[cfg_attr(feature = "cuda", derive(cust_core::DeviceCopy))]
#[derive(Debug, PartialEq, Copy, Clone)]
#[repr(C)]
pub struct Aabb {
Expand Down
4 changes: 2 additions & 2 deletions src/bounding_volume/aabb_heightfield.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use crate::bounding_volume::Aabb;
use crate::math::{Isometry, Real};
use crate::shape::{GenericHeightField, HeightFieldStorage};
use crate::shape::HeightField;

impl<Storage: HeightFieldStorage> GenericHeightField<Storage> {
impl HeightField {
/// Computes the world-space [`Aabb`] of this heightfield, transformed by `pos`.
#[inline]
pub fn aabb(&self, pos: &Isometry<Real>) -> Aabb {
Expand Down
4 changes: 2 additions & 2 deletions src/bounding_volume/bounding_sphere_heightfield.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use crate::bounding_volume::BoundingSphere;
use crate::math::{Isometry, Real};
use crate::shape::{GenericHeightField, HeightFieldStorage};
use crate::shape::HeightField;

impl<Storage: HeightFieldStorage> GenericHeightField<Storage> {
impl HeightField {
/// Computes the world-space bounding sphere of this height-field, transformed by `pos`.
#[inline]
pub fn bounding_sphere(&self, pos: &Isometry<Real>) -> BoundingSphere {
Expand Down
2 changes: 2 additions & 0 deletions src/bounding_volume/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ mod aabb_convex_polygon;
mod aabb_convex_polyhedron;
mod aabb_cuboid;
mod aabb_halfspace;
#[cfg(feature = "std")]
mod aabb_heightfield;
mod aabb_support_map;
mod aabb_triangle;
Expand All @@ -45,6 +46,7 @@ mod bounding_sphere_cuboid;
#[cfg(feature = "dim3")]
mod bounding_sphere_cylinder;
mod bounding_sphere_halfspace;
#[cfg(feature = "std")]
mod bounding_sphere_heightfield;
#[cfg(feature = "std")]
mod bounding_sphere_polyline;
Expand Down
1 change: 0 additions & 1 deletion src/bounding_volume/simd_aabb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ use simba::simd::{SimdPartialOrd, SimdValue};
derive(rkyv::Archive, rkyv::Deserialize, rkyv::Serialize),
archive(check_bytes)
)]
#[cfg_attr(feature = "cuda", derive(cust_core::DeviceCopy))]
pub struct SimdAabb {
/// The min coordinates of the Aabbs.
pub mins: Point<SimdReal>,
Expand Down
8 changes: 4 additions & 4 deletions src/partitioning/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@
#[cfg(feature = "std")]
pub use self::qbvh::{
CenterDataSplitter, QbvhDataGenerator, QbvhNonOverlappingDataSplitter, QbvhUpdateWorkspace,
};
pub use self::qbvh::{
GenericQbvh, IndexedData, NodeIndex, Qbvh, QbvhNode, QbvhProxy, QbvhStorage, SimdNodeIndex,
CenterDataSplitter, IndexedData, NodeIndex, Qbvh, QbvhDataGenerator, QbvhNode,
QbvhNonOverlappingDataSplitter, QbvhProxy, QbvhUpdateWorkspace, SimdNodeIndex,
};
#[cfg(feature = "parallel")]
pub use self::visitor::{ParallelSimdSimultaneousVisitor, ParallelSimdVisitor};
Expand All @@ -16,7 +14,9 @@ pub use self::visitor::{

/// A quaternary bounding-volume-hierarchy.
#[deprecated(note = "Renamed to Qbvh")]
#[cfg(feature = "std")]
pub type SimdQbvh<T> = Qbvh<T>;

#[cfg(feature = "std")]
mod qbvh;
mod visitor;
10 changes: 1 addition & 9 deletions src/partitioning/qbvh/mod.rs
Original file line number Diff line number Diff line change
@@ -1,23 +1,15 @@
#[cfg(feature = "std")]
pub use self::{
build::{CenterDataSplitter, QbvhDataGenerator, QbvhNonOverlappingDataSplitter},
update::QbvhUpdateWorkspace,
};

pub use self::qbvh::{
GenericQbvh, IndexedData, NodeIndex, Qbvh, QbvhNode, QbvhNodeFlags, QbvhProxy, SimdNodeIndex,
IndexedData, NodeIndex, Qbvh, QbvhNode, QbvhNodeFlags, QbvhProxy, SimdNodeIndex,
};
pub use self::storage::QbvhStorage;

mod qbvh;
mod storage;
mod utils;

#[cfg(feature = "std")]
mod build;
#[cfg(feature = "std")]
mod traversal;
#[cfg(not(feature = "std"))]
mod traversal_no_std;
#[cfg(feature = "std")]
mod update;
Loading

0 comments on commit 57a472f

Please sign in to comment.