Closed
Description
I was trying to modify the HelloWasm
app to use WebGPU for running in a browser.
But CMake fails:
Could NOT find Halide_WebGPU (missing: Halide_WebGPU_NATIVE_LIB)
Why is Halide_WebGPU_NATIVE_LIB
required when targetting the web browser?
The command that fails is:
set(target "wasm-32-wasmrt-webgpu")
set(config "wasm")
foreach (gen IN ITEMS init update render)
add_halide_library(${config}_${gen} FROM reaction_diffusion_generator
GENERATOR reaction_diffusion_${gen}
FUNCTION_NAME reaction_diffusion_${gen}
PARAMS threads=false
TARGETS ${target})
endforeach ()
After the following fix in HalideGeneratorHelpers.cmake
, it worked:
if ("${ARGN}" MATCHES "webgpu")
if ("${ARGN}" MATCHES "host-webgpu")
PS: However, the wasn't enough to actually make the app use WebGPU
(how can I know?), so more help is appreciated 😉