Skip to content

Commit

Permalink
Remove CUDA support relying on abandoned toolchain
Browse files Browse the repository at this point in the history
  • Loading branch information
Ralith committed Jan 12, 2024
1 parent a60870d commit 7866bce
Show file tree
Hide file tree
Showing 21 changed files with 6 additions and 104 deletions.
19 changes: 0 additions & 19 deletions .github/workflows/nalgebra-ci-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@ jobs:
build-nalgebra-all-features:
runs-on: ubuntu-latest
steps:
# Needed because the --all-features build which enables cuda support.
- uses: Jimver/cuda-toolkit@v0.2.8
- uses: actions/checkout@v2
- run: cargo build --all-features;
- run: cargo build -p nalgebra-glm --all-features;
Expand Down Expand Up @@ -120,23 +118,6 @@ jobs:
run: xargo build --verbose --no-default-features -p nalgebra-glm --target=x86_64-unknown-linux-gnu;
- name: build thumbv7em-none-eabihf nalgebra-glm
run: xargo build --verbose --no-default-features -p nalgebra-glm --target=thumbv7em-none-eabihf;
build-cuda:
runs-on: ubuntu-latest
steps:
- uses: Jimver/cuda-toolkit@v0.2.8
with:
cuda: '11.5.0'
- name: Install nightly-2021-12-04
uses: actions-rs/toolchain@v1
with:
toolchain: nightly-2021-12-04
override: true
- uses: actions/checkout@v2
- run: rustup target add nvptx64-nvidia-cuda
- run: cargo build --no-default-features --features cuda
- run: cargo build --no-default-features --features cuda --target=nvptx64-nvidia-cuda
env:
CUDA_ARCH: "350"
docs:
runs-on: ubuntu-latest
steps:
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ documented here.

This project adheres to [Semantic Versioning](https://semver.org/).

## Unreleased

### Removed
- The `cuda` feature has been removed, as the toolchain it depends on
is long abandoned.

## [0.32.3] (09 July 2023)

### Modified
Expand Down
2 changes: 0 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ compare = [ "matrixcompare-core" ]
libm = [ "simba/libm" ]
libm-force = [ "simba/libm_force" ]
macros = [ "nalgebra-macros" ]
cuda = [ "cust_core", "simba/cuda" ]


# Conversion
Expand Down Expand Up @@ -104,7 +103,6 @@ glam021 = { package = "glam", version = "0.21", optional = true }
glam022 = { package = "glam", version = "0.22", optional = true }
glam023 = { package = "glam", version = "0.23", optional = true }
glam024 = { package = "glam", version = "0.24", optional = true }
cust_core = { version = "0.1", optional = true }
rayon = { version = "1.6", optional = true }

[dev-dependencies]
Expand Down
1 change: 0 additions & 1 deletion nalgebra-glm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ default = [ "std" ]
std = [ "nalgebra/std", "simba/std" ]
arbitrary = [ "nalgebra/arbitrary" ]
serde-serialize = [ "nalgebra/serde-serialize-no-std" ]
cuda = [ "nalgebra/cuda" ]

# Conversion
convert-mint = [ "nalgebra/mint" ]
Expand Down
1 change: 0 additions & 1 deletion src/base/array_storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ use std::mem;
)
)]
#[cfg_attr(feature = "rkyv-serialize", derive(bytecheck::CheckBytes))]
#[cfg_attr(feature = "cuda", derive(cust_core::DeviceCopy))]
pub struct ArrayStorage<T, const R: usize, const C: usize>(pub [[T; R]; C]);

impl<T, const R: usize, const C: usize> ArrayStorage<T, R, C> {
Expand Down
2 changes: 0 additions & 2 deletions src/base/dimension.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ use serde::{Deserialize, Deserializer, Serialize, Serializer};
feature = "rkyv-serialize",
archive_attr(derive(bytecheck::CheckBytes))
)]
#[cfg_attr(feature = "cuda", derive(cust_core::DeviceCopy))]
pub struct Dyn(pub usize);

#[deprecated(note = "use Dyn instead.")]
Expand Down Expand Up @@ -220,7 +219,6 @@ dim_ops!(
archive(as = "Self")
)]
#[cfg_attr(feature = "rkyv-serialize", derive(bytecheck::CheckBytes))]
#[cfg_attr(feature = "cuda", derive(cust_core::DeviceCopy))]
pub struct Const<const R: usize>;

/// Trait implemented exclusively by type-level integers.
Expand Down
1 change: 0 additions & 1 deletion src/base/matrix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,6 @@ pub type MatrixCross<T, R1, C1, R2, C2> =
)
)]
#[cfg_attr(feature = "rkyv-serialize", derive(bytecheck::CheckBytes))]
#[cfg_attr(feature = "cuda", derive(cust_core::DeviceCopy))]
pub struct Matrix<T, R, C, S> {
/// The data storage that contains all the matrix components. Disappointed?
///
Expand Down
11 changes: 0 additions & 11 deletions src/base/unit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ use rkyv::bytecheck;
)
)]
#[cfg_attr(feature = "rkyv-serialize", derive(bytecheck::CheckBytes))]
// #[cfg_attr(feature = "cuda", derive(cust_core::DeviceCopy))]
pub struct Unit<T> {
pub(crate) value: T,
}
Expand Down Expand Up @@ -72,16 +71,6 @@ impl<'de, T: Deserialize<'de>> Deserialize<'de> for Unit<T> {
}
}

#[cfg(feature = "cuda")]
unsafe impl<T: cust_core::DeviceCopy, R, C, S> cust_core::DeviceCopy for Unit<Matrix<T, R, C, S>>
where
T: Scalar,
R: Dim,
C: Dim,
S: RawStorage<T, R, C> + Copy,
{
}

impl<T, R, C, S> PartialEq for Unit<Matrix<T, R, C, S>>
where
T: Scalar + PartialEq,
Expand Down
1 change: 0 additions & 1 deletion src/geometry/dual_quaternion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ use simba::scalar::{ClosedNeg, RealField};
)
)]
#[cfg_attr(feature = "rkyv-serialize", derive(bytecheck::CheckBytes))]
#[cfg_attr(feature = "cuda", derive(cust_core::DeviceCopy))]
pub struct DualQuaternion<T> {
/// The real component of the quaternion
pub real: Quaternion<T>,
Expand Down
1 change: 0 additions & 1 deletion src/geometry/isometry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ use rkyv::bytecheck;
///
#[repr(C)]
#[derive(Debug, Copy, Clone)]
#[cfg_attr(feature = "cuda", derive(cust_core::DeviceCopy))]
#[cfg_attr(feature = "serde-serialize-no-std", derive(Serialize, Deserialize))]
#[cfg_attr(
feature = "serde-serialize-no-std",
Expand Down
1 change: 0 additions & 1 deletion src/geometry/orthographic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ use rkyv::bytecheck;
)
)]
#[cfg_attr(feature = "rkyv-serialize", derive(bytecheck::CheckBytes))]
#[cfg_attr(feature = "cuda", derive(cust_core::DeviceCopy))]
#[derive(Copy, Clone)]
pub struct Orthographic3<T> {
matrix: Matrix4<T>,
Expand Down
1 change: 0 additions & 1 deletion src/geometry/perspective.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ use rkyv::bytecheck;
)
)]
#[cfg_attr(feature = "rkyv-serialize", derive(bytecheck::CheckBytes))]
#[cfg_attr(feature = "cuda", derive(cust_core::DeviceCopy))]
#[derive(Copy, Clone)]
pub struct Perspective3<T> {
matrix: Matrix4<T>,
Expand Down
8 changes: 0 additions & 8 deletions src/geometry/point.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,14 +86,6 @@ where
{
}

#[cfg(feature = "cuda")]
unsafe impl<T: Scalar + cust_core::DeviceCopy, D: DimName> cust_core::DeviceCopy for OPoint<T, D>
where
DefaultAllocator: Allocator<T, D>,
OVector<T, D>: cust_core::DeviceCopy,
{
}

#[cfg(feature = "bytemuck")]
unsafe impl<T: Scalar, D: DimName> bytemuck::Zeroable for OPoint<T, D>
where
Expand Down
31 changes: 0 additions & 31 deletions src/geometry/point_construction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -202,29 +202,11 @@ impl<T: Scalar> Point1<T> {
/// assert_eq!(p.x, 1.0);
/// ```
#[inline]
#[cfg(not(feature = "cuda"))]
pub const fn new(x: T) -> Self {
Point {
coords: Vector1::new(x),
}
}

/// Initializes this point from its components.
///
/// # Example
///
/// ```
/// # use nalgebra::Point1;
/// let p = Point1::new(1.0);
/// assert_eq!(p.x, 1.0);
/// ```
#[inline]
#[cfg(feature = "cuda")]
pub fn new(x: T) -> Self {
Point {
coords: Vector1::new(x),
}
}
}
macro_rules! componentwise_constructors_impl(
($($doc: expr; $Point: ident, $Vector: ident, $($args: ident:$irow: expr),*);* $(;)*) => {$(
Expand All @@ -234,22 +216,9 @@ macro_rules! componentwise_constructors_impl(
#[doc = $doc]
#[doc = "```"]
#[inline]
#[cfg(not(feature = "cuda"))]
pub const fn new($($args: T),*) -> Self {
Point { coords: $Vector::new($($args),*) }
}

// TODO: always let new be const once CUDA updates its supported
// nightly version to something more recent.
#[doc = "Initializes this point from its components."]
#[doc = "# Example\n```"]
#[doc = $doc]
#[doc = "```"]
#[inline]
#[cfg(feature = "cuda")]
pub fn new($($args: T),*) -> Self {
Point { coords: $Vector::new($($args),*) }
}
}
)*}
);
Expand Down
4 changes: 0 additions & 4 deletions src/geometry/quaternion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ use rkyv::bytecheck;
)
)]
#[cfg_attr(feature = "rkyv-serialize", derive(bytecheck::CheckBytes))]
#[cfg_attr(feature = "cuda", derive(cust_core::DeviceCopy))]
pub struct Quaternion<T> {
/// This quaternion as a 4D vector of coordinates in the `[ x, y, z, w ]` storage order.
pub coords: Vector4<T>,
Expand Down Expand Up @@ -1016,9 +1015,6 @@ impl<T: RealField + fmt::Display> fmt::Display for Quaternion<T> {
/// A unit quaternions. May be used to represent a rotation.
pub type UnitQuaternion<T> = Unit<Quaternion<T>>;

#[cfg(feature = "cuda")]
unsafe impl<T: cust_core::DeviceCopy> cust_core::DeviceCopy for UnitQuaternion<T> {}

impl<T: Scalar + ClosedNeg + PartialEq> PartialEq for UnitQuaternion<T> {
#[inline]
fn eq(&self, rhs: &Self) -> bool {
Expand Down
1 change: 0 additions & 1 deletion src/geometry/rotation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ use rkyv::bytecheck;
)
)]
#[cfg_attr(feature = "rkyv-serialize", derive(bytecheck::CheckBytes))]
#[cfg_attr(feature = "cuda", derive(cust_core::DeviceCopy))]
#[derive(Copy, Clone)]
pub struct Rotation<T, const D: usize> {
matrix: SMatrix<T, D, D>,
Expand Down
1 change: 0 additions & 1 deletion src/geometry/scale.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ use rkyv::bytecheck;
)
)]
#[cfg_attr(feature = "rkyv-serialize", derive(bytecheck::CheckBytes))]
#[cfg_attr(feature = "cuda", derive(cust_core::DeviceCopy))]
#[derive(Copy, Clone)]
pub struct Scale<T, const D: usize> {
/// The scale coordinates, i.e., how much is multiplied to a point's coordinates when it is
Expand Down
1 change: 0 additions & 1 deletion src/geometry/similarity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ use rkyv::bytecheck;
/// A similarity, i.e., an uniform scaling, followed by a rotation, followed by a translation.
#[repr(C)]
#[derive(Debug, Copy, Clone)]
#[cfg_attr(feature = "cuda", derive(cust_core::DeviceCopy))]
#[cfg_attr(feature = "serde-serialize-no-std", derive(Serialize, Deserialize))]
#[cfg_attr(
feature = "serde-serialize-no-std",
Expand Down
13 changes: 0 additions & 13 deletions src/geometry/transform.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,17 +60,14 @@ where

/// Tag representing the most general (not necessarily inversible) `Transform` type.
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
#[cfg_attr(feature = "cuda", derive(cust_core::DeviceCopy))]
pub enum TGeneral {}

/// Tag representing the most general inversible `Transform` type.
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
#[cfg_attr(feature = "cuda", derive(cust_core::DeviceCopy))]
pub enum TProjective {}

/// Tag representing an affine `Transform`. Its bottom-row is equal to `(0, 0 ... 0, 1)`.
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
#[cfg_attr(feature = "cuda", derive(cust_core::DeviceCopy))]
pub enum TAffine {}

impl TCategory for TGeneral {
Expand Down Expand Up @@ -198,16 +195,6 @@ where
{
}

#[cfg(feature = "cuda")]
unsafe impl<T: RealField + cust_core::DeviceCopy, C: TCategory, const D: usize>
cust_core::DeviceCopy for Transform<T, C, D>
where
Const<D>: DimNameAdd<U1>,
DefaultAllocator: Allocator<T, DimNameSum<Const<D>, U1>, DimNameSum<Const<D>, U1>>,
Owned<T, DimNameSum<Const<D>, U1>, DimNameSum<Const<D>, U1>>: cust_core::DeviceCopy,
{
}

impl<T: RealField, C: TCategory, const D: usize> Clone for Transform<T, C, D>
where
Const<D>: DimNameAdd<U1>,
Expand Down
1 change: 0 additions & 1 deletion src/geometry/translation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ use rkyv::bytecheck;
)
)]
#[cfg_attr(feature = "rkyv-serialize", derive(bytecheck::CheckBytes))]
#[cfg_attr(feature = "cuda", derive(cust_core::DeviceCopy))]
#[derive(Copy, Clone)]
pub struct Translation<T, const D: usize> {
/// The translation coordinates, i.e., how much is added to a point's coordinates when it is
Expand Down
3 changes: 0 additions & 3 deletions src/geometry/unit_complex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,6 @@ use std::cmp::{Eq, PartialEq};
/// * [Conversion to a matrix <span style="float:right;">`to_rotation_matrix`, `to_homogeneous`…</span>](#conversion-to-a-matrix)
pub type UnitComplex<T> = Unit<Complex<T>>;

#[cfg(feature = "cuda")]
unsafe impl<T: cust_core::DeviceCopy> cust_core::DeviceCopy for UnitComplex<T> {}

impl<T: Scalar + PartialEq> PartialEq for UnitComplex<T> {
#[inline]
fn eq(&self, rhs: &Self) -> bool {
Expand Down

0 comments on commit 7866bce

Please sign in to comment.