From 7866bcee5c4f3c1f9d9d86116fd96d000e7453b9 Mon Sep 17 00:00:00 2001 From: Benjamin Saunders Date: Sat, 16 Dec 2023 13:03:09 -0800 Subject: [PATCH] Remove CUDA support relying on abandoned toolchain --- .github/workflows/nalgebra-ci-build.yml | 19 --------------- CHANGELOG.md | 6 +++++ Cargo.toml | 2 -- nalgebra-glm/Cargo.toml | 1 - src/base/array_storage.rs | 1 - src/base/dimension.rs | 2 -- src/base/matrix.rs | 1 - src/base/unit.rs | 11 --------- src/geometry/dual_quaternion.rs | 1 - src/geometry/isometry.rs | 1 - src/geometry/orthographic.rs | 1 - src/geometry/perspective.rs | 1 - src/geometry/point.rs | 8 ------- src/geometry/point_construction.rs | 31 ------------------------- src/geometry/quaternion.rs | 4 ---- src/geometry/rotation.rs | 1 - src/geometry/scale.rs | 1 - src/geometry/similarity.rs | 1 - src/geometry/transform.rs | 13 ----------- src/geometry/translation.rs | 1 - src/geometry/unit_complex.rs | 3 --- 21 files changed, 6 insertions(+), 104 deletions(-) diff --git a/.github/workflows/nalgebra-ci-build.yml b/.github/workflows/nalgebra-ci-build.yml index d7027127..97b42184 100644 --- a/.github/workflows/nalgebra-ci-build.yml +++ b/.github/workflows/nalgebra-ci-build.yml @@ -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; @@ -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: diff --git a/CHANGELOG.md b/CHANGELOG.md index b73ea701..f92dfffb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/Cargo.toml b/Cargo.toml index 6658cfb2..16551aa1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -32,7 +32,6 @@ compare = [ "matrixcompare-core" ] libm = [ "simba/libm" ] libm-force = [ "simba/libm_force" ] macros = [ "nalgebra-macros" ] -cuda = [ "cust_core", "simba/cuda" ] # Conversion @@ -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] diff --git a/nalgebra-glm/Cargo.toml b/nalgebra-glm/Cargo.toml index 1ebcfb65..6b06d9cc 100644 --- a/nalgebra-glm/Cargo.toml +++ b/nalgebra-glm/Cargo.toml @@ -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" ] diff --git a/src/base/array_storage.rs b/src/base/array_storage.rs index 56e88d47..4ac738a1 100644 --- a/src/base/array_storage.rs +++ b/src/base/array_storage.rs @@ -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(pub [[T; R]; C]); impl ArrayStorage { diff --git a/src/base/dimension.rs b/src/base/dimension.rs index 0b72e188..17b9d9d3 100644 --- a/src/base/dimension.rs +++ b/src/base/dimension.rs @@ -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.")] @@ -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; /// Trait implemented exclusively by type-level integers. diff --git a/src/base/matrix.rs b/src/base/matrix.rs index 36c95544..7daa4f1a 100644 --- a/src/base/matrix.rs +++ b/src/base/matrix.rs @@ -171,7 +171,6 @@ pub type MatrixCross = ) )] #[cfg_attr(feature = "rkyv-serialize", derive(bytecheck::CheckBytes))] -#[cfg_attr(feature = "cuda", derive(cust_core::DeviceCopy))] pub struct Matrix { /// The data storage that contains all the matrix components. Disappointed? /// diff --git a/src/base/unit.rs b/src/base/unit.rs index 12c70963..b8e62b8c 100644 --- a/src/base/unit.rs +++ b/src/base/unit.rs @@ -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 { pub(crate) value: T, } @@ -72,16 +71,6 @@ impl<'de, T: Deserialize<'de>> Deserialize<'de> for Unit { } } -#[cfg(feature = "cuda")] -unsafe impl cust_core::DeviceCopy for Unit> -where - T: Scalar, - R: Dim, - C: Dim, - S: RawStorage + Copy, -{ -} - impl PartialEq for Unit> where T: Scalar + PartialEq, diff --git a/src/geometry/dual_quaternion.rs b/src/geometry/dual_quaternion.rs index 3d073fff..8bd0cc81 100644 --- a/src/geometry/dual_quaternion.rs +++ b/src/geometry/dual_quaternion.rs @@ -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 { /// The real component of the quaternion pub real: Quaternion, diff --git a/src/geometry/isometry.rs b/src/geometry/isometry.rs index 376af06f..e2dc93a3 100644 --- a/src/geometry/isometry.rs +++ b/src/geometry/isometry.rs @@ -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", diff --git a/src/geometry/orthographic.rs b/src/geometry/orthographic.rs index 2d809fe4..5cf2a4c8 100644 --- a/src/geometry/orthographic.rs +++ b/src/geometry/orthographic.rs @@ -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 { matrix: Matrix4, diff --git a/src/geometry/perspective.rs b/src/geometry/perspective.rs index 383c99b9..fd0c75dd 100644 --- a/src/geometry/perspective.rs +++ b/src/geometry/perspective.rs @@ -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 { matrix: Matrix4, diff --git a/src/geometry/point.rs b/src/geometry/point.rs index 789d2e6a..94bd95a7 100644 --- a/src/geometry/point.rs +++ b/src/geometry/point.rs @@ -86,14 +86,6 @@ where { } -#[cfg(feature = "cuda")] -unsafe impl cust_core::DeviceCopy for OPoint -where - DefaultAllocator: Allocator, - OVector: cust_core::DeviceCopy, -{ -} - #[cfg(feature = "bytemuck")] unsafe impl bytemuck::Zeroable for OPoint where diff --git a/src/geometry/point_construction.rs b/src/geometry/point_construction.rs index 04228cd2..b60e65ac 100644 --- a/src/geometry/point_construction.rs +++ b/src/geometry/point_construction.rs @@ -202,29 +202,11 @@ impl Point1 { /// 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),*);* $(;)*) => {$( @@ -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),*) } - } } )*} ); diff --git a/src/geometry/quaternion.rs b/src/geometry/quaternion.rs index 18c6a80d..829a7da2 100644 --- a/src/geometry/quaternion.rs +++ b/src/geometry/quaternion.rs @@ -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 { /// This quaternion as a 4D vector of coordinates in the `[ x, y, z, w ]` storage order. pub coords: Vector4, @@ -1016,9 +1015,6 @@ impl fmt::Display for Quaternion { /// A unit quaternions. May be used to represent a rotation. pub type UnitQuaternion = Unit>; -#[cfg(feature = "cuda")] -unsafe impl cust_core::DeviceCopy for UnitQuaternion {} - impl PartialEq for UnitQuaternion { #[inline] fn eq(&self, rhs: &Self) -> bool { diff --git a/src/geometry/rotation.rs b/src/geometry/rotation.rs index e2ea81ed..d09a862a 100644 --- a/src/geometry/rotation.rs +++ b/src/geometry/rotation.rs @@ -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 { matrix: SMatrix, diff --git a/src/geometry/scale.rs b/src/geometry/scale.rs index 2c09b70d..31985e5a 100644 --- a/src/geometry/scale.rs +++ b/src/geometry/scale.rs @@ -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 { /// The scale coordinates, i.e., how much is multiplied to a point's coordinates when it is diff --git a/src/geometry/similarity.rs b/src/geometry/similarity.rs index 4d931947..630ebac6 100644 --- a/src/geometry/similarity.rs +++ b/src/geometry/similarity.rs @@ -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", diff --git a/src/geometry/transform.rs b/src/geometry/transform.rs index 0bafc951..5e468792 100755 --- a/src/geometry/transform.rs +++ b/src/geometry/transform.rs @@ -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 { @@ -198,16 +195,6 @@ where { } -#[cfg(feature = "cuda")] -unsafe impl - cust_core::DeviceCopy for Transform -where - Const: DimNameAdd, - DefaultAllocator: Allocator, U1>, DimNameSum, U1>>, - Owned, U1>, DimNameSum, U1>>: cust_core::DeviceCopy, -{ -} - impl Clone for Transform where Const: DimNameAdd, diff --git a/src/geometry/translation.rs b/src/geometry/translation.rs index 4fc50777..d626b1dc 100644 --- a/src/geometry/translation.rs +++ b/src/geometry/translation.rs @@ -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 { /// The translation coordinates, i.e., how much is added to a point's coordinates when it is diff --git a/src/geometry/unit_complex.rs b/src/geometry/unit_complex.rs index d6c0ade5..a04df89b 100755 --- a/src/geometry/unit_complex.rs +++ b/src/geometry/unit_complex.rs @@ -31,9 +31,6 @@ use std::cmp::{Eq, PartialEq}; /// * [Conversion to a matrix `to_rotation_matrix`, `to_homogeneous`…](#conversion-to-a-matrix) pub type UnitComplex = Unit>; -#[cfg(feature = "cuda")] -unsafe impl cust_core::DeviceCopy for UnitComplex {} - impl PartialEq for UnitComplex { #[inline] fn eq(&self, rhs: &Self) -> bool {