From 678ab2c1af4d2a178c9962f886eb41458183f479 Mon Sep 17 00:00:00 2001 From: marcus Date: Thu, 13 Jun 2024 17:33:41 -0700 Subject: [PATCH] include more stuff and fix cuda --- llama-cpp-sys-2/Cargo.toml | 2 ++ llama-cpp-sys-2/build.rs | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/llama-cpp-sys-2/Cargo.toml b/llama-cpp-sys-2/Cargo.toml index da24c89c..0dae9980 100644 --- a/llama-cpp-sys-2/Cargo.toml +++ b/llama-cpp-sys-2/Cargo.toml @@ -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 diff --git a/llama-cpp-sys-2/build.rs b/llama-cpp-sys-2/build.rs index eaa52e55..010e7fed 100644 --- a/llama-cpp-sys-2/build.rs +++ b/llama-cpp-sys-2/build.rs @@ -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);