Rust-GPU / Rust-CUDA

Ecosystem of libraries and tools for writing and executing fast GPU code fully in Rust.
Apache License 2.0
3.12k stars 120 forks source link

Sorting an array doesn’t compile when targeting nvvm #11

Closed sebcrozet closed 2 years ago

sebcrozet commented 2 years ago

The following piece of code:

let mut foo = [1usize, 2];
foo.sort_unstable();

fails to compile with the error:

error: internal compiler error: C:\Users\devel\.cargo\registry\src\github.com-1ecc6299db9ec823\rustc_codegen_nvvm-0.1.0\src\context.rs:373:32: unknown intrinsic 'llvm.bswap.i64'

I originally triggered this error while attempting to use the sorted variant of the SVD decomposition in nalgebra.

RDambrosio016 commented 2 years ago

Weird, looks like somewhere along the line i deleted bswap from ctx_intrinsics, which is wrong because nvvm supports it

RDambrosio016 commented 2 years ago

Should be fixed in cg_nvvm 0.1.1