Skip to content

Commit 19fb0d9

Browse files
committed
add dummy first call
1 parent 7b259f0 commit 19fb0d9

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

Runtime/Core/LlamaBackend.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ public static void Init()
4242
{
4343
if (count == 0)
4444
{
45+
Native.llama_max_devices();
46+
4547
#if UNITY_STANDALONE_WIN || UNITY_EDITOR_WIN
4648
string packagePath = NativeDllPath.GetDirectory("llama.dll");
4749
Native.ggml_backend_load(Path.Join(packagePath, "ggml-cpu-x64.dll"));

Runtime/Native/LlamaNative.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,10 @@ public unsafe struct llama_token_data_array
175175
[DllImport(LlamaDll, CallingConvention = CallingConvention.Cdecl)]
176176
public static extern void llama_log_set(ggml_log_callback log_callback, IntPtr user_data);
177177

178+
[DllImport(LlamaDll, CallingConvention = CallingConvention.Cdecl)]
179+
public static extern long llama_max_devices();
180+
181+
178182
// backend
179183
[DllImport(LlamaDll, CallingConvention = CallingConvention.Cdecl)]
180184
public static extern void llama_backend_init();

0 commit comments

Comments
 (0)