Skip to content

Commit 44fe261

Browse files
committed
Fixed some version dependent parts
1 parent eb4b0b1 commit 44fe261

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

LLama/Native/NativeApi.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,15 @@ private static IntPtr TryLoadLibrary()
4141
{
4242
if (Environment.OSVersion.Platform == PlatformID.Win32NT)
4343
{
44+
#if NET6_0_OR_GREATER
4445
var cuda = LoadLibrary("win-cuda12/libllama.dll");
4546
if (cuda != IntPtr.Zero)
4647
return cuda;
4748

4849
cuda = LoadLibrary("win-cuda11/libllama.dll");
4950
if (cuda != IntPtr.Zero)
5051
return cuda;
52+
#endif
5153

5254
#if NET8_0_OR_GREATER
5355
if (System.Runtime.Intrinsics.X86.Avx512.IsSupported)
@@ -60,8 +62,8 @@ private static IntPtr TryLoadLibrary()
6062

6163
if (System.Runtime.Intrinsics.X86.Avx.IsSupported)
6264
return LoadLibrary("win-avx/libllama.dll");
63-
}
6465
#endif
66+
}
6567

6668
return IntPtr.Zero;
6769
}

0 commit comments

Comments
 (0)