Skip to content

Commit 7866bce

Browse files
committed
Remove CUDA support relying on abandoned toolchain
1 parent a60870d commit 7866bce

21 files changed

+6
-104
lines changed

.github/workflows/nalgebra-ci-build.yml

-19
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,6 @@ jobs:
4949
build-nalgebra-all-features:
5050
runs-on: ubuntu-latest
5151
steps:
52-
# Needed because the --all-features build which enables cuda support.
53-
- uses: Jimver/[email protected]
5452
- uses: actions/checkout@v2
5553
- run: cargo build --all-features;
5654
- run: cargo build -p nalgebra-glm --all-features;
@@ -120,23 +118,6 @@ jobs:
120118
run: xargo build --verbose --no-default-features -p nalgebra-glm --target=x86_64-unknown-linux-gnu;
121119
- name: build thumbv7em-none-eabihf nalgebra-glm
122120
run: xargo build --verbose --no-default-features -p nalgebra-glm --target=thumbv7em-none-eabihf;
123-
build-cuda:
124-
runs-on: ubuntu-latest
125-
steps:
126-
- uses: Jimver/[email protected]
127-
with:
128-
cuda: '11.5.0'
129-
- name: Install nightly-2021-12-04
130-
uses: actions-rs/toolchain@v1
131-
with:
132-
toolchain: nightly-2021-12-04
133-
override: true
134-
- uses: actions/checkout@v2
135-
- run: rustup target add nvptx64-nvidia-cuda
136-
- run: cargo build --no-default-features --features cuda
137-
- run: cargo build --no-default-features --features cuda --target=nvptx64-nvidia-cuda
138-
env:
139-
CUDA_ARCH: "350"
140121
docs:
141122
runs-on: ubuntu-latest
142123
steps:

CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ documented here.
44

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

7+
## Unreleased
8+
9+
### Removed
10+
- The `cuda` feature has been removed, as the toolchain it depends on
11+
is long abandoned.
12+
713
## [0.32.3] (09 July 2023)
814

915
### Modified

Cargo.toml

-2
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ compare = [ "matrixcompare-core" ]
3232
libm = [ "simba/libm" ]
3333
libm-force = [ "simba/libm_force" ]
3434
macros = [ "nalgebra-macros" ]
35-
cuda = [ "cust_core", "simba/cuda" ]
3635

3736

3837
# Conversion
@@ -104,7 +103,6 @@ glam021 = { package = "glam", version = "0.21", optional = true }
104103
glam022 = { package = "glam", version = "0.22", optional = true }
105104
glam023 = { package = "glam", version = "0.23", optional = true }
106105
glam024 = { package = "glam", version = "0.24", optional = true }
107-
cust_core = { version = "0.1", optional = true }
108106
rayon = { version = "1.6", optional = true }
109107

110108
[dev-dependencies]

nalgebra-glm/Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ default = [ "std" ]
2121
std = [ "nalgebra/std", "simba/std" ]
2222
arbitrary = [ "nalgebra/arbitrary" ]
2323
serde-serialize = [ "nalgebra/serde-serialize-no-std" ]
24-
cuda = [ "nalgebra/cuda" ]
2524

2625
# Conversion
2726
convert-mint = [ "nalgebra/mint" ]

src/base/array_storage.rs

-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ use std::mem;
4242
)
4343
)]
4444
#[cfg_attr(feature = "rkyv-serialize", derive(bytecheck::CheckBytes))]
45-
#[cfg_attr(feature = "cuda", derive(cust_core::DeviceCopy))]
4645
pub struct ArrayStorage<T, const R: usize, const C: usize>(pub [[T; R]; C]);
4746

4847
impl<T, const R: usize, const C: usize> ArrayStorage<T, R, C> {

src/base/dimension.rs

-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ use serde::{Deserialize, Deserializer, Serialize, Serializer};
2323
feature = "rkyv-serialize",
2424
archive_attr(derive(bytecheck::CheckBytes))
2525
)]
26-
#[cfg_attr(feature = "cuda", derive(cust_core::DeviceCopy))]
2726
pub struct Dyn(pub usize);
2827

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

226224
/// Trait implemented exclusively by type-level integers.

src/base/matrix.rs

-1
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,6 @@ pub type MatrixCross<T, R1, C1, R2, C2> =
171171
)
172172
)]
173173
#[cfg_attr(feature = "rkyv-serialize", derive(bytecheck::CheckBytes))]
174-
#[cfg_attr(feature = "cuda", derive(cust_core::DeviceCopy))]
175174
pub struct Matrix<T, R, C, S> {
176175
/// The data storage that contains all the matrix components. Disappointed?
177176
///

src/base/unit.rs

-11
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ use rkyv::bytecheck;
3535
)
3636
)]
3737
#[cfg_attr(feature = "rkyv-serialize", derive(bytecheck::CheckBytes))]
38-
// #[cfg_attr(feature = "cuda", derive(cust_core::DeviceCopy))]
3938
pub struct Unit<T> {
4039
pub(crate) value: T,
4140
}
@@ -72,16 +71,6 @@ impl<'de, T: Deserialize<'de>> Deserialize<'de> for Unit<T> {
7271
}
7372
}
7473

75-
#[cfg(feature = "cuda")]
76-
unsafe impl<T: cust_core::DeviceCopy, R, C, S> cust_core::DeviceCopy for Unit<Matrix<T, R, C, S>>
77-
where
78-
T: Scalar,
79-
R: Dim,
80-
C: Dim,
81-
S: RawStorage<T, R, C> + Copy,
82-
{
83-
}
84-
8574
impl<T, R, C, S> PartialEq for Unit<Matrix<T, R, C, S>>
8675
where
8776
T: Scalar + PartialEq,

src/geometry/dual_quaternion.rs

-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ use simba::scalar::{ClosedNeg, RealField};
5555
)
5656
)]
5757
#[cfg_attr(feature = "rkyv-serialize", derive(bytecheck::CheckBytes))]
58-
#[cfg_attr(feature = "cuda", derive(cust_core::DeviceCopy))]
5958
pub struct DualQuaternion<T> {
6059
/// The real component of the quaternion
6160
pub real: Quaternion<T>,

src/geometry/isometry.rs

-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ use rkyv::bytecheck;
5454
///
5555
#[repr(C)]
5656
#[derive(Debug, Copy, Clone)]
57-
#[cfg_attr(feature = "cuda", derive(cust_core::DeviceCopy))]
5857
#[cfg_attr(feature = "serde-serialize-no-std", derive(Serialize, Deserialize))]
5958
#[cfg_attr(
6059
feature = "serde-serialize-no-std",

src/geometry/orthographic.rs

-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ use rkyv::bytecheck;
3434
)
3535
)]
3636
#[cfg_attr(feature = "rkyv-serialize", derive(bytecheck::CheckBytes))]
37-
#[cfg_attr(feature = "cuda", derive(cust_core::DeviceCopy))]
3837
#[derive(Copy, Clone)]
3938
pub struct Orthographic3<T> {
4039
matrix: Matrix4<T>,

src/geometry/perspective.rs

-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ use rkyv::bytecheck;
3535
)
3636
)]
3737
#[cfg_attr(feature = "rkyv-serialize", derive(bytecheck::CheckBytes))]
38-
#[cfg_attr(feature = "cuda", derive(cust_core::DeviceCopy))]
3938
#[derive(Copy, Clone)]
4039
pub struct Perspective3<T> {
4140
matrix: Matrix4<T>,

src/geometry/point.rs

-8
Original file line numberDiff line numberDiff line change
@@ -86,14 +86,6 @@ where
8686
{
8787
}
8888

89-
#[cfg(feature = "cuda")]
90-
unsafe impl<T: Scalar + cust_core::DeviceCopy, D: DimName> cust_core::DeviceCopy for OPoint<T, D>
91-
where
92-
DefaultAllocator: Allocator<T, D>,
93-
OVector<T, D>: cust_core::DeviceCopy,
94-
{
95-
}
96-
9789
#[cfg(feature = "bytemuck")]
9890
unsafe impl<T: Scalar, D: DimName> bytemuck::Zeroable for OPoint<T, D>
9991
where

src/geometry/point_construction.rs

-31
Original file line numberDiff line numberDiff line change
@@ -202,29 +202,11 @@ impl<T: Scalar> Point1<T> {
202202
/// assert_eq!(p.x, 1.0);
203203
/// ```
204204
#[inline]
205-
#[cfg(not(feature = "cuda"))]
206205
pub const fn new(x: T) -> Self {
207206
Point {
208207
coords: Vector1::new(x),
209208
}
210209
}
211-
212-
/// Initializes this point from its components.
213-
///
214-
/// # Example
215-
///
216-
/// ```
217-
/// # use nalgebra::Point1;
218-
/// let p = Point1::new(1.0);
219-
/// assert_eq!(p.x, 1.0);
220-
/// ```
221-
#[inline]
222-
#[cfg(feature = "cuda")]
223-
pub fn new(x: T) -> Self {
224-
Point {
225-
coords: Vector1::new(x),
226-
}
227-
}
228210
}
229211
macro_rules! componentwise_constructors_impl(
230212
($($doc: expr; $Point: ident, $Vector: ident, $($args: ident:$irow: expr),*);* $(;)*) => {$(
@@ -234,22 +216,9 @@ macro_rules! componentwise_constructors_impl(
234216
#[doc = $doc]
235217
#[doc = "```"]
236218
#[inline]
237-
#[cfg(not(feature = "cuda"))]
238219
pub const fn new($($args: T),*) -> Self {
239220
Point { coords: $Vector::new($($args),*) }
240221
}
241-
242-
// TODO: always let new be const once CUDA updates its supported
243-
// nightly version to something more recent.
244-
#[doc = "Initializes this point from its components."]
245-
#[doc = "# Example\n```"]
246-
#[doc = $doc]
247-
#[doc = "```"]
248-
#[inline]
249-
#[cfg(feature = "cuda")]
250-
pub fn new($($args: T),*) -> Self {
251-
Point { coords: $Vector::new($($args),*) }
252-
}
253222
}
254223
)*}
255224
);

src/geometry/quaternion.rs

-4
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ use rkyv::bytecheck;
3838
)
3939
)]
4040
#[cfg_attr(feature = "rkyv-serialize", derive(bytecheck::CheckBytes))]
41-
#[cfg_attr(feature = "cuda", derive(cust_core::DeviceCopy))]
4241
pub struct Quaternion<T> {
4342
/// This quaternion as a 4D vector of coordinates in the `[ x, y, z, w ]` storage order.
4443
pub coords: Vector4<T>,
@@ -1016,9 +1015,6 @@ impl<T: RealField + fmt::Display> fmt::Display for Quaternion<T> {
10161015
/// A unit quaternions. May be used to represent a rotation.
10171016
pub type UnitQuaternion<T> = Unit<Quaternion<T>>;
10181017

1019-
#[cfg(feature = "cuda")]
1020-
unsafe impl<T: cust_core::DeviceCopy> cust_core::DeviceCopy for UnitQuaternion<T> {}
1021-
10221018
impl<T: Scalar + ClosedNeg + PartialEq> PartialEq for UnitQuaternion<T> {
10231019
#[inline]
10241020
fn eq(&self, rhs: &Self) -> bool {

src/geometry/rotation.rs

-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ use rkyv::bytecheck;
6464
)
6565
)]
6666
#[cfg_attr(feature = "rkyv-serialize", derive(bytecheck::CheckBytes))]
67-
#[cfg_attr(feature = "cuda", derive(cust_core::DeviceCopy))]
6867
#[derive(Copy, Clone)]
6968
pub struct Rotation<T, const D: usize> {
7069
matrix: SMatrix<T, D, D>,

src/geometry/scale.rs

-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ use rkyv::bytecheck;
3232
)
3333
)]
3434
#[cfg_attr(feature = "rkyv-serialize", derive(bytecheck::CheckBytes))]
35-
#[cfg_attr(feature = "cuda", derive(cust_core::DeviceCopy))]
3635
#[derive(Copy, Clone)]
3736
pub struct Scale<T, const D: usize> {
3837
/// The scale coordinates, i.e., how much is multiplied to a point's coordinates when it is

src/geometry/similarity.rs

-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ use rkyv::bytecheck;
2121
/// A similarity, i.e., an uniform scaling, followed by a rotation, followed by a translation.
2222
#[repr(C)]
2323
#[derive(Debug, Copy, Clone)]
24-
#[cfg_attr(feature = "cuda", derive(cust_core::DeviceCopy))]
2524
#[cfg_attr(feature = "serde-serialize-no-std", derive(Serialize, Deserialize))]
2625
#[cfg_attr(
2726
feature = "serde-serialize-no-std",

src/geometry/transform.rs

-13
Original file line numberDiff line numberDiff line change
@@ -60,17 +60,14 @@ where
6060

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

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

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

7673
impl TCategory for TGeneral {
@@ -198,16 +195,6 @@ where
198195
{
199196
}
200197

201-
#[cfg(feature = "cuda")]
202-
unsafe impl<T: RealField + cust_core::DeviceCopy, C: TCategory, const D: usize>
203-
cust_core::DeviceCopy for Transform<T, C, D>
204-
where
205-
Const<D>: DimNameAdd<U1>,
206-
DefaultAllocator: Allocator<T, DimNameSum<Const<D>, U1>, DimNameSum<Const<D>, U1>>,
207-
Owned<T, DimNameSum<Const<D>, U1>, DimNameSum<Const<D>, U1>>: cust_core::DeviceCopy,
208-
{
209-
}
210-
211198
impl<T: RealField, C: TCategory, const D: usize> Clone for Transform<T, C, D>
212199
where
213200
Const<D>: DimNameAdd<U1>,

src/geometry/translation.rs

-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ use rkyv::bytecheck;
3232
)
3333
)]
3434
#[cfg_attr(feature = "rkyv-serialize", derive(bytecheck::CheckBytes))]
35-
#[cfg_attr(feature = "cuda", derive(cust_core::DeviceCopy))]
3635
#[derive(Copy, Clone)]
3736
pub struct Translation<T, const D: usize> {
3837
/// The translation coordinates, i.e., how much is added to a point's coordinates when it is

src/geometry/unit_complex.rs

-3
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,6 @@ use std::cmp::{Eq, PartialEq};
3131
/// * [Conversion to a matrix <span style="float:right;">`to_rotation_matrix`, `to_homogeneous`…</span>](#conversion-to-a-matrix)
3232
pub type UnitComplex<T> = Unit<Complex<T>>;
3333

34-
#[cfg(feature = "cuda")]
35-
unsafe impl<T: cust_core::DeviceCopy> cust_core::DeviceCopy for UnitComplex<T> {}
36-
3734
impl<T: Scalar + PartialEq> PartialEq for UnitComplex<T> {
3835
#[inline]
3936
fn eq(&self, rhs: &Self) -> bool {

0 commit comments

Comments
 (0)