Skip to content

Commit 1c558b2

Browse files
committed
Use CARGO_MANIFEST_DIR for add example build script
1 parent 53c8400 commit 1c558b2

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

examples/cuda/cpu/add/build.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
use cuda_builder::CudaBuilder;
22

33
fn main() {
4-
CudaBuilder::new("../../gpu/add_gpu")
5-
.copy_to("../../resources/add.ptx")
4+
let manifest_dir = std::env::var("CARGO_MANIFEST_DIR").expect("CARGO_MANIFEST_DIR exists");
5+
let manifest_dir = std::path::Path::new(&manifest_dir);
6+
CudaBuilder::new(manifest_dir.join("../../gpu/add_gpu"))
7+
.copy_to(manifest_dir.join("../../resources/add.ptx"))
68
.build()
79
.unwrap();
810
}

0 commit comments

Comments
 (0)