Skip to content
Merged
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
8 changes: 4 additions & 4 deletions cuda-oxide/crates/cargo-oxide/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -418,13 +418,13 @@ When `cargo oxide` needs the `librustc_codegen_cuda.so` backend, it searches in
Outside the repository the backend follows the project's `Cargo.lock`:

```text
Cargo.lock cuda-device = git+https://github.com/NVlabs/cuda-oxide.git#a1b4f118...
Cargo.lock cuda-device = git+https://github.com/NVIDIA/cuda-rust.git#<sha>
│
▼
~/.cargo/git/checkouts/cuda-oxide-*/a1b4f11/ Cargo's checkout of that commit
│ crates/rustc-codegen-cuda → cargo build
~/.cargo/git/checkouts/cuda-rust-*/<sha>/ Cargo's checkout of that commit
│ cuda-oxide/crates/rustc-codegen-cuda → cargo build
▼
~/.cargo/cuda-oxide/librustc_codegen_cuda.so + source-rev.txt = a1b4f118...
~/.cargo/cuda-oxide/librustc_codegen_cuda.so + source-rev.txt = <sha>
```

The kernels compile against the crates at that commit and the backend that
Expand Down
2 changes: 1 addition & 1 deletion cuda-oxide/crates/cargo-oxide/src/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1247,7 +1247,7 @@ fn auto_fetch_and_build() -> PathBuf {
"clone",
"--depth",
"1",
"https://github.com/NVlabs/cuda-oxide.git",
"https://github.com/NVIDIA/cuda-rust.git",
src_dir.to_str().unwrap(),
])
.status()
Expand Down
12 changes: 6 additions & 6 deletions cuda-oxide/crates/cargo-oxide/src/backend_source.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@
//! dependency instead of from a separately cloned `main`:
//!
//! ```text
//! Cargo.lock cuda-device = git+https://github.com/NVlabs/cuda-oxide.git#<sha>
//! Cargo.lock cuda-device = git+https://github.com/NVIDIA/cuda-rust.git#<sha>
//! │ cargo metadata: package.manifest_path
//! ▼
//! ~/.cargo/git/checkouts/cuda-oxide-<hash>/<sha>/crates/cuda-device/Cargo.toml
//! │ walk up to the repository root
//! ~/.cargo/git/checkouts/cuda-rust-<hash>/<sha>/cuda-oxide/crates/cuda-device/Cargo.toml
//! │ walk up to the checkout root that holds the backend crate
//! ▼
//! ~/.cargo/git/checkouts/cuda-oxide-<hash>/<sha>/crates/rustc-codegen-cuda built
//! ~/.cargo/git/checkouts/cuda-oxide-<hash>/<sha>/rust-toolchain.toml nightly it needs
//! ~/.cargo/git/checkouts/cuda-rust-<hash>/<sha>/cuda-oxide/crates/rustc-codegen-cuda built
//! ~/.cargo/git/checkouts/cuda-rust-<hash>/<sha>/cuda-oxide/rust-toolchain.toml nightly it needs
//! ```
//!
//! The checkout's `rust-toolchain.toml` matters as much as the code: the
Expand Down Expand Up @@ -316,7 +316,7 @@ mod tests {
use serde_json::json;
use std::time::SystemTime;

const REPO: &str = "https://github.com/NVlabs/cuda-oxide.git";
const REPO: &str = "https://github.com/NVIDIA/cuda-rust.git";
const SHA: &str = "a1b4f11882592fae9d022c86a9d8d1a4c9426980";

/// Lays out what Cargo's checkout of the repository looks like: the crate
Expand Down
2 changes: 1 addition & 1 deletion cuda-oxide/crates/cargo-oxide/src/commands/scaffold.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use super::*;
// cargo oxide new -- standalone project scaffolding
// =========================================================================

const GIT_REPO: &str = "https://github.com/NVlabs/cuda-oxide.git";
const GIT_REPO: &str = "https://github.com/NVIDIA/cuda-rust.git";

/// crates.io release of the host-side runtime (`cuda-core`, `cuda-async`).
/// In-tree examples and `cuda-host` path-depend on the git-root copies;
Expand Down
15 changes: 15 additions & 0 deletions cuda-oxide/crates/cargo-oxide/src/commands/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4878,6 +4878,21 @@ fn scaffold_gitignore_covers_every_clean_artifact_suffix() {
}
}

#[test]
fn scaffold_names_the_canonical_repository() {
// Both templates must name the repository the crates live in now; the
// pre-move URL resolves only through GitHub's redirect.
for async_mode in [false, true] {
let files = scaffold_files("demo_kernel", async_mode);
assert!(
files
.cargo_toml
.contains("git = \"https://github.com/NVIDIA/cuda-rust.git\"")
);
assert!(!files.cargo_toml.contains("NVlabs"));
}
}

#[test]
fn device_debug_env_value_matches_the_backend_parser() {
// The exported strings must round-trip through the shared
Expand Down
Loading