Skip to content

Commit

Permalink
include more stuff and fix cuda
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcusDunn committed Jun 14, 2024
1 parent 15857a2 commit 678ab2c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions llama-cpp-sys-2/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ include = [
"/llama.cpp/ggml-common.h",
"/llama.cpp/ggml-cuda",
"/llama.cpp/sgemm.h",
"/llama.cpp/ggml-cuda/*",
"/llama.cpp/ggml-cuda/template_instances/*",
]

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand Down
7 changes: 7 additions & 0 deletions llama-cpp-sys-2/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -463,10 +463,17 @@ fn compile_cuda(cx: &mut Build, cxx: &mut Build, featless_cxx: Build) -> &'stati
.map(|f| f.unwrap())
.filter(|entry| entry.file_name().to_string_lossy().ends_with(".cu"))
.map(|entry| entry.path());

let template_instances = read_dir(cuda_path.join("template-instances"))
.unwrap()
.map(|f| f.unwrap())
.filter(|entry| entry.file_name().to_string_lossy().ends_with(".cu"))
.map(|entry| entry.path());

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

Expand Down

0 comments on commit 678ab2c

Please sign in to comment.