mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-05-19 21:32:23 +00:00
### Description I've added changes to support CUDA and DML (only on Windows, on other platforms it will throw an error) ### Motivation and Context It fixes this feature request https://github.com/microsoft/onnxruntime/issues/14127 which is tracked here https://github.com/microsoft/onnxruntime/issues/14529 I was working on StableDiffusion implementation for node.js and it is very slow on CPU, so GPU support is essential. Here is a working demo with a patched and precompiled version https://github.com/dakenf/stable-diffusion-nodejs ---------
15 lines
470 B
C++
15 lines
470 B
C++
// Copyright (c) Microsoft Corporation. All rights reserved.
|
|
// Licensed under the MIT License.
|
|
|
|
#pragma once
|
|
|
|
#include <napi.h>
|
|
#include <vector>
|
|
|
|
#include "onnxruntime_cxx_api.h"
|
|
|
|
// convert a Javascript OnnxValue object to an OrtValue object
|
|
Ort::Value NapiValueToOrtValue(Napi::Env env, Napi::Value value, OrtMemoryInfo *memory_info);
|
|
|
|
// convert an OrtValue object to a Javascript OnnxValue object
|
|
Napi::Value OrtValueToNapiValue(Napi::Env env, Ort::Value &value);
|