Skip to content

Commit 309cd3c

Browse files
committed
Fixed some version dependent parts
1 parent a4effd3 commit 309cd3c

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
@@ -40,13 +40,15 @@ private static IntPtr TryLoadLibrary()
4040
{
4141
if (Environment.OSVersion.Platform == PlatformID.Win32NT)
4242
{
43+
#if NET6_0_OR_GREATER
4344
var cuda = LoadLibrary("win-cuda12/libllama.dll");
4445
if (cuda != IntPtr.Zero)
4546
return cuda;
4647

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

5153
#if NET8_0_OR_GREATER
5254
if (System.Runtime.Intrinsics.X86.Avx512.IsSupported)
@@ -59,8 +61,8 @@ private static IntPtr TryLoadLibrary()
5961

6062
if (System.Runtime.Intrinsics.X86.Avx.IsSupported)
6163
return LoadLibrary("win-avx/libllama.dll");
62-
}
6364
#endif
65+
}
6466

6567
return IntPtr.Zero;
6668
}

0 commit comments

Comments
 (0)