Skip to content

Commit

Permalink
Revert "Merge feat: add detection template for cuda and avx. SciSharp…
Browse files Browse the repository at this point in the history
…#268"

This reverts commit b4b3ea9.
  • Loading branch information
SignalRT committed Nov 9, 2023
1 parent b4b3ea9 commit 200011e
Show file tree
Hide file tree
Showing 11 changed files with 26 additions and 26 deletions.
36 changes: 18 additions & 18 deletions LLama/LLamaSharp.Runtime.targets
Original file line number Diff line number Diff line change
Expand Up @@ -3,41 +3,41 @@
<IncludeBuiltInRuntimes Condition="'$(IncludeBuiltInRuntimes)' == ''">true</IncludeBuiltInRuntimes>
</PropertyGroup>
<ItemGroup Condition="'$(IncludeBuiltInRuntimes)' == 'true'">
<None Include="$(MSBuildThisFileDirectory)runtimes/win-x64/libllama.dll">
<None Include="$(MSBuildThisFileDirectory)runtimes/libllama.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<Link>runtimes/win-x64/libllama.dll</Link>
<Link>libllama.dll</Link>
</None>
<None Include="$(MSBuildThisFileDirectory)runtimes/win-x64/libllama-cuda11.dll">
<None Include="$(MSBuildThisFileDirectory)runtimes/libllama-cuda11.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<Link>runtimes/win-x64/libllama-cuda11.dll</Link>
<Link>libllama-cuda11.dll</Link>
</None>
<None Include="$(MSBuildThisFileDirectory)runtimes/win-x64/libllama-cuda12.dll">
<None Include="$(MSBuildThisFileDirectory)runtimes/libllama-cuda12.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<Link>runtimes/win-x64/libllama-cuda12.dll</Link>
<Link>libllama-cuda12.dll</Link>
</None>
<None Include="$(MSBuildThisFileDirectory)runtimes/linux-x64/libllama.so">
<None Include="$(MSBuildThisFileDirectory)runtimes/libllama.so">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<Link>runtimes/linux-x64/libllama.so</Link>
<Link>libllama.so</Link>
</None>
<None Include="$(MSBuildThisFileDirectory)runtimes/linux-x64/libllama-cuda11.so">
<None Include="$(MSBuildThisFileDirectory)runtimes/libllama-cuda11.so">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<Link>runtimes/linux-x64/libllama-cuda11.so</Link>
<Link>libllama-cuda11.so</Link>
</None>
<None Include="$(MSBuildThisFileDirectory)runtimes/linux-x64/libllama-cuda12.so">
<None Include="$(MSBuildThisFileDirectory)runtimes/libllama-cuda12.so">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<Link>runtimes/linux-x64/libllama-cuda12.so</Link>
<Link>libllama-cuda12.so</Link>
</None>
<None Include="$(MSBuildThisFileDirectory)runtimes/osx-arm64/libllama.dylib">
<None Include="$(MSBuildThisFileDirectory)runtimes/macos-arm64/libllama.dylib">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<Link>runtimes/osx-arm64/libllama.dylib</Link>
<Link>runtimes/macos-arm64/libllama.dylib</Link>
</None>
<None Include="$(MSBuildThisFileDirectory)runtimes/osx-arm64/ggml-metal.metal">
<None Include="$(MSBuildThisFileDirectory)runtimes/macos-arm64/ggml-metal.metal">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<Link>runtimes/osx-arm64/ggml-metal.metal</Link>
<Link>runtimes/macos-arm64/ggml-metal.metal</Link>
</None>
<None Include="$(MSBuildThisFileDirectory)runtimes/osx-x64/libllama.dylib">
<None Include="$(MSBuildThisFileDirectory)runtimes/macos-x86_64/libllama.dylib">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<Link>runtimes/osx-x64/libllama.dylib</Link>
<Link>runtimes/macos-x86_64/libllama.dylib</Link>
</None>
</ItemGroup>
</Project>
16 changes: 8 additions & 8 deletions LLama/Native/NativeApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -110,15 +110,15 @@ private static IntPtr LLamaImportResolver(string name, Assembly assembly, DllImp
var cudaVersion = GetCudaVersion();
if(cudaVersion == 11)
{
libraryPath = $"runtimes/win-x64/libllama-cuda11{avxFlag}.dll";
libraryPath = $"runtimes/win-x64/native/libllama-cuda11{avxFlag}.dll";
}
else if (cudaVersion == 12)
{
libraryPath = $"runtimes/win-x64/libllama-cuda12{avxFlag}.dll";
libraryPath = $"runtimes/win-x64/native/libllama-cuda12{avxFlag}.dll";
}
else if(cudaVersion == -1) // cpu version
{
libraryPath = $"runtimes/win-x64/libllama{avxFlag}.dll";
libraryPath = $"runtimes/win-x64/native/libllama{avxFlag}.dll";
}
else
{
Expand All @@ -132,15 +132,15 @@ private static IntPtr LLamaImportResolver(string name, Assembly assembly, DllImp
var cudaVersion = GetCudaVersion();
if (cudaVersion == 11)
{
libraryPath = $"runtimes/linux-x64/libllama-cuda11{avxFlag}.so";
libraryPath = $"runtimes/linux-x64/native/libllama-cuda11{avxFlag}.so";
}
else if (cudaVersion == 12)
{
libraryPath = $"runtimes/linux-x64/libllama-cuda12{avxFlag}.so";
libraryPath = $"runtimes/linux-x64/native/libllama-cuda12{avxFlag}.so";
}
else if (cudaVersion == -1) // cpu version
{
libraryPath = $"runtimes/linux-x64/libllama{avxFlag}.so";
libraryPath = $"runtimes/linux-x64/native/libllama{avxFlag}.so";
}
else
{
Expand All @@ -151,11 +151,11 @@ private static IntPtr LLamaImportResolver(string name, Assembly assembly, DllImp
{
if (System.Runtime.Intrinsics.Arm.ArmBase.Arm64.IsSupported)
{
libraryPath = $"runtimes/osx-arm64/libllama.dylib";
libraryPath = $"runtimes/osx-arm64/native/libllama.dylib";
}
else
{
libraryPath = $"runtimes/osx-x86_64/libllama.dylib";
libraryPath = $"runtimes/osx-x64/native/libllama.dylib";
}
}

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 200011e

Please sign in to comment.