Skip to content

Commit

Permalink
added cuda support (again)
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcusDunn committed Jul 9, 2024
1 parent 9f5b40f commit 1788762
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions llama-cpp-sys-2/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,9 @@ fn compile_cuda(cx: &mut Build, cxx: &mut Build, featless_cxx: Build) -> &'stati
}

let lib_name = "ggml-cuda";
let cuda_path = LLAMA_PATH.join("ggml-cuda");
let ggml_path = LLAMA_PATH.join("ggml");
let ggml_src = ggml_path.join("src");
let cuda_path = ggml_src.join("ggml-cuda");
let cuda_sources = read_dir(cuda_path.as_path())
.unwrap()
.map(|f| f.unwrap())
Expand All @@ -464,10 +466,11 @@ fn compile_cuda(cx: &mut Build, cxx: &mut Build, featless_cxx: Build) -> &'stati
.map(|entry| entry.path());

nvcc.include(cuda_path.as_path())
.include(LLAMA_PATH.as_path())
.include(ggml_src.as_path())
.include(ggml_path.join("include").as_path())
.files(cuda_sources)
.files(template_instances)
.file(LLAMA_PATH.join("ggml-cuda.cu"))
.file(ggml_src.join("ggml-cuda.cu"))
.compile(lib_name);

lib_name
Expand Down

0 comments on commit 1788762

Please sign in to comment.