Skip to content

Commit

Permalink
[WASI-NN] Metal related options should only apply on macOS
Browse files Browse the repository at this point in the history
Signed-off-by: hydai <[email protected]>
  • Loading branch information
hydai committed Oct 3, 2023
1 parent f21e4da commit 52cf102
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ option(WASMEDGE_LINK_TOOLS_STATIC "Statically link the wasmedge and wasmedgec to
option(WASMEDGE_ENABLE_UB_SANITIZER "Enable undefined behavior sanitizer." OFF)
set(WASMEDGE_PLUGIN_WASI_NN_BACKEND "" CACHE STRING "Enable WasmEdge Wasi-NN plugin with backends.")
option(WASMEDGE_PLUGIN_WASI_NN_GGML_LLAMA_BLAS "Enable LLAMA_BLAS in the WASI-NN GGML backend" ON)
option(WASMEDGE_PLUGIN_WASI_NN_GGML_LLAMA_METAL "Enable LLAMA_METAL in the WASI-NN GGML backend" ON)
option(WASMEDGE_PLUGIN_WASI_NN_GGML_LLAMA_METAL "Enable LLAMA_METAL in the WASI-NN GGML backend" OFF)
# Currently supported WASI-NN backend: "OpenVINO" on Linux x86_64
option(WASMEDGE_PLUGIN_WASI_CRYPTO "Enable WasmEdge Wasi-crypto plugin." OFF)
option(WASMEDGE_PLUGIN_WASI_LOGGING "Enable WasmEdge wasi-logging plugin." OFF)
Expand Down
5 changes: 5 additions & 0 deletions plugins/wasi_nn/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ else()
message(STATUS "WASI-NN GGML LLAMA backend: Disable LLAMA_BLAS")
set(LLAMA_BLAS OFF)
endif()

if(NOT APPLE)
set(WASMEDGE_PLUGIN_WASI_NN_GGML_LLAMA_METAL OFF)
endif()

if(WASMEDGE_PLUGIN_WASI_NN_GGML_LLAMA_METAL)
message(STATUS "WASI-NN GGML LLAMA backend: Enable LLAMA_METAL")
set(LLAMA_METAL ON)
Expand Down

0 comments on commit 52cf102

Please sign in to comment.