MCPcopy Create free account
hub / github.com/WasmEdge/WasmEdge / GetDeviceString

Function GetDeviceString

plugins/wasi_nn/wasinn_openvino.cpp:14–30  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

12#ifdef WASMEDGE_PLUGIN_WASI_NN_BACKEND_OPENVINO
13
14static Expect<WASINN::ErrNo>
15GetDeviceString(WASINN::Device TargetDevice,
16 std::string &DeviceString) noexcept {
17 switch (TargetDevice) {
18 case Device::AUTO:
19 case Device::CPU:
20 DeviceString = "CPU";
21 break;
22 case Device::GPU:
23 DeviceString = "GPU";
24 break;
25 default:
26 spdlog::error("[WASI-NN] Unsupported device type"sv);
27 return WASINN::ErrNo::InvalidArgument;
28 }
29 return WASINN::ErrNo::Success;
30}
31
32Expect<WASINN::ErrNo> load(WASINN::WasiNNEnvironment &Env,
33 Span<const Span<uint8_t>> Builders,

Callers 1

setInputFunction · 0.70

Calls 1

errorFunction · 0.50

Tested by

no test coverage detected