Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/ci_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@ jobs:
RUSTFLAGS: -Dwarnings
run: cargo clippy --workspace --exclude "optix*" --exclude "path-tracer" --exclude "denoiser" --exclude "ex0*" --exclude "cudnn*"

# Don't currently test because many tests rely on the system having a CUDA GPU
# - name: Test
# run: cargo test --workspace
# Very limited testing because we can only run tests that don't rely on having a CUDA GPU.
- name: Test
run: cargo test -p cuda_std -p gpu_rand -p nvvm -p rustc_codegen_nvvm

- name: Check documentation
env:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/ci_windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,9 @@ jobs:
RUSTFLAGS: -Dwarnings
run: cargo clippy --workspace --exclude "optix*" --exclude "path-tracer" --exclude "denoiser" --exclude "vecadd*" --exclude "gemm*" --exclude "ex0*" --exclude "cudnn*" --exclude "sha2*"

# Don't currently test because many tests rely on the system having a CUDA GPU
# - name: Test
# run: cargo test --workspace
# Very limited testing because we can only run tests that don't rely on having a CUDA GPU.
- name: Test
run: cargo test -p cuda_std -p gpu_rand -p nvvm -p rustc_codegen_nvvm

- name: Check documentation
env:
Expand Down
20 changes: 14 additions & 6 deletions crates/cuda_std/src/thread.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,24 @@
//! ## Computing global indices (examples)
//!
//! 1D global thread index:
//! ```rust
//! use cuda_std::thread;
//! let gx = thread::block_idx_x() * thread::block_dim_x() + thread::thread_idx_x();
//! ```no_run
//! # use cuda_std::kernel;
//! ##[kernel]
//! pub unsafe fn f1d() {
//! use cuda_std::thread;
//! let gx = thread::block_idx_x() * thread::block_dim_x() + thread::thread_idx_x();
//! }
//! ```
//!
//! 2D global coordinates (x, y):
//! ```rust
//! use cuda_std::thread;
//! let x = thread::block_idx_x() * thread::block_dim_x() + thread::thread_idx_x();
//! let y = thread::block_idx_y() * thread::block_dim_y() + thread::thread_idx_y();
//! # use cuda_std::kernel;
//! ##[kernel]
//! pub unsafe fn f2d() {
//! use cuda_std::thread;
//! let x = thread::block_idx_x() * thread::block_dim_x() + thread::thread_idx_x();
//! let y = thread::block_idx_y() * thread::block_dim_y() + thread::thread_idx_y();
//! }
//! ```
//!
//! Note: Hardware limits for block dimensions, grid dimensions, and total threads per block
Expand Down
4 changes: 2 additions & 2 deletions crates/gpu_rand/src/xoroshiro/xoroshiro128plus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ impl Xoroshiro128Plus {
/// parallel computations.
///
/// ```
/// use rand_xoshiro::rand_core::SeedableRng;
/// use rand_xoshiro::Xoroshiro128Plus;
/// use gpu_rand::xoroshiro::rand_core::SeedableRng;
/// use gpu_rand::xoroshiro::Xoroshiro128Plus;
///
/// let rng1 = Xoroshiro128Plus::seed_from_u64(0);
/// let mut rng2 = rng1.clone();
Expand Down
4 changes: 2 additions & 2 deletions crates/gpu_rand/src/xoroshiro/xoroshiro128plusplus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ impl Xoroshiro128PlusPlus {
/// parallel computations.
///
/// ```
/// use rand_xoshiro::rand_core::SeedableRng;
/// use rand_xoshiro::Xoroshiro128PlusPlus;
/// use gpu_rand::xoroshiro::rand_core::SeedableRng;
/// use gpu_rand::xoroshiro::Xoroshiro128PlusPlus;
///
/// let rng1 = Xoroshiro128PlusPlus::seed_from_u64(0);
/// let mut rng2 = rng1.clone();
Expand Down
4 changes: 2 additions & 2 deletions crates/gpu_rand/src/xoroshiro/xoroshiro128starstar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ impl Xoroshiro128StarStar {
/// parallel computations.
///
/// ```
/// use rand_xoshiro::rand_core::SeedableRng;
/// use rand_xoshiro::Xoroshiro128StarStar;
/// use gpu_rand::xoroshiro::rand_core::SeedableRng;
/// use gpu_rand::xoroshiro::Xoroshiro128StarStar;
///
/// let rng1 = Xoroshiro128StarStar::seed_from_u64(0);
/// let mut rng2 = rng1.clone();
Expand Down
4 changes: 2 additions & 2 deletions crates/gpu_rand/src/xoroshiro/xoshiro128plus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ impl Xoshiro128Plus {
/// parallel computations.
///
/// ```
/// use rand_xoshiro::rand_core::SeedableRng;
/// use rand_xoshiro::Xoroshiro128StarStar;
/// use gpu_rand::xoroshiro::rand_core::SeedableRng;
/// use gpu_rand::xoroshiro::Xoroshiro128StarStar;
///
/// let rng1 = Xoroshiro128StarStar::seed_from_u64(0);
/// let mut rng2 = rng1.clone();
Expand Down
4 changes: 2 additions & 2 deletions crates/gpu_rand/src/xoroshiro/xoshiro128plusplus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ impl Xoshiro128PlusPlus {
/// parallel computations.
///
/// ```
/// use rand_xoshiro::rand_core::SeedableRng;
/// use rand_xoshiro::Xoroshiro128PlusPlus;
/// use gpu_rand::xoroshiro::rand_core::SeedableRng;
/// use gpu_rand::xoroshiro::Xoroshiro128PlusPlus;
///
/// let rng1 = Xoroshiro128PlusPlus::seed_from_u64(0);
/// let mut rng2 = rng1.clone();
Expand Down
4 changes: 2 additions & 2 deletions crates/gpu_rand/src/xoroshiro/xoshiro128starstar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ impl Xoshiro128StarStar {
/// parallel computations.
///
/// ```
/// use rand_xoshiro::rand_core::SeedableRng;
/// use rand_xoshiro::Xoroshiro128StarStar;
/// use gpu_rand::xoroshiro::rand_core::SeedableRng;
/// use gpu_rand::xoroshiro::Xoroshiro128StarStar;
///
/// let rng1 = Xoroshiro128StarStar::seed_from_u64(0);
/// let mut rng2 = rng1.clone();
Expand Down
4 changes: 2 additions & 2 deletions crates/gpu_rand/src/xoroshiro/xoshiro256plus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ impl Xoshiro256Plus {
/// parallel computations.
///
/// ```
/// use rand_xoshiro::rand_core::SeedableRng;
/// use rand_xoshiro::Xoshiro256Plus;
/// use gpu_rand::xoroshiro::rand_core::SeedableRng;
/// use gpu_rand::xoroshiro::Xoshiro256Plus;
///
/// let rng1 = Xoshiro256Plus::seed_from_u64(0);
/// let mut rng2 = rng1.clone();
Expand Down
4 changes: 2 additions & 2 deletions crates/gpu_rand/src/xoroshiro/xoshiro256plusplus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ impl Xoshiro256PlusPlus {
/// parallel computations.
///
/// ```
/// use rand_xoshiro::rand_core::SeedableRng;
/// use rand_xoshiro::Xoshiro256PlusPlus;
/// use gpu_rand::xoroshiro::rand_core::SeedableRng;
/// use gpu_rand::xoroshiro::Xoshiro256PlusPlus;
///
/// let rng1 = Xoshiro256PlusPlus::seed_from_u64(0);
/// let mut rng2 = rng1.clone();
Expand Down
4 changes: 2 additions & 2 deletions crates/gpu_rand/src/xoroshiro/xoshiro256starstar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ impl Xoshiro256StarStar {
/// parallel computations.
///
/// ```
/// use rand_xoshiro::rand_core::SeedableRng;
/// use rand_xoshiro::Xoshiro256StarStar;
/// use gpu_rand::xoroshiro::rand_core::SeedableRng;
/// use gpu_rand::xoroshiro::Xoshiro256StarStar;
///
/// let rng1 = Xoshiro256StarStar::seed_from_u64(0);
/// let mut rng2 = rng1.clone();
Expand Down
4 changes: 2 additions & 2 deletions crates/gpu_rand/src/xoroshiro/xoshiro512plus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ impl Xoshiro512Plus {
/// parallel computations.
///
/// ```
/// use rand_xoshiro::rand_core::SeedableRng;
/// use rand_xoshiro::Xoshiro512Plus;
/// use gpu_rand::xoroshiro::rand_core::SeedableRng;
/// use gpu_rand::xoroshiro::Xoshiro512Plus;
///
/// let rng1 = Xoshiro512Plus::seed_from_u64(0);
/// let mut rng2 = rng1.clone();
Expand Down
4 changes: 2 additions & 2 deletions crates/gpu_rand/src/xoroshiro/xoshiro512plusplus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ impl Xoshiro512PlusPlus {
/// parallel computations.
///
/// ```
/// use rand_xoshiro::rand_core::SeedableRng;
/// use rand_xoshiro::Xoshiro512PlusPlus;
/// use gpu_rand::xoroshiro::rand_core::SeedableRng;
/// use gpu_rand::xoroshiro::Xoshiro512PlusPlus;
///
/// let rng1 = Xoshiro512PlusPlus::seed_from_u64(0);
/// let mut rng2 = rng1.clone();
Expand Down
4 changes: 2 additions & 2 deletions crates/gpu_rand/src/xoroshiro/xoshiro512starstar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ impl Xoshiro512StarStar {
/// parallel computations.
///
/// ```
/// use rand_xoshiro::rand_core::SeedableRng;
/// use rand_xoshiro::Xoshiro512StarStar;
/// use gpu_rand::xoroshiro::rand_core::SeedableRng;
/// use gpu_rand::xoroshiro::Xoshiro512StarStar;
///
/// let rng1 = Xoshiro512StarStar::seed_from_u64(0);
/// let mut rng2 = rng1.clone();
Expand Down
Loading