Browse Source

Merge pull request #47 from SignalRT/master

MacOS metal support
tags/v0.4.2-preview
Rinne GitHub 2 years ago
parent
commit
098d5b1544
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 1961 additions and 2 deletions
  1. +4
    -0
      LLama/LLamaSharp.Runtime.targets
  2. +2
    -2
      LLama/Native/NativeApi.cs
  3. +1955
    -0
      LLama/runtimes/ggml-metal.metal
  4. BIN
      LLama/runtimes/libllama.dylib

+ 4
- 0
LLama/LLamaSharp.Runtime.targets View File

@@ -31,5 +31,9 @@
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<Link>libllama.dylib</Link>
</None>
<None Include="$(MSBuildThisFileDirectory)runtimes/ggml-metal.metal">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<Link>ggml-metal.metal</Link>
</None>
</ItemGroup>
</Project>

+ 2
- 2
LLama/Native/NativeApi.cs View File

@@ -25,7 +25,7 @@ namespace LLama.Native
"3. The backend is not compatible with your system cuda environment. Please check and fix it. If the environment is " +
"expected not to be changed, then consider build llama.cpp from source or submit an issue to LLamaSharp.");
}
NativeApi.llama_init_backend();
NativeApi.llama_backend_init();
}
private const string libraryName = "libllama";

@@ -64,7 +64,7 @@ namespace LLama.Native
/// Call once at the start of the program
/// </summary>
[DllImport(libraryName, CallingConvention = CallingConvention.Cdecl)]
public static extern void llama_init_backend();
public static extern void llama_backend_init();

/// <summary>
/// Frees all allocated memory


+ 1955
- 0
LLama/runtimes/ggml-metal.metal
File diff suppressed because it is too large
View File


BIN
LLama/runtimes/libllama.dylib View File


Loading…
Cancel
Save