From e512048f74601561a6eef7166722a9eece952925 Mon Sep 17 00:00:00 2001 From: Yulong Wang <7679871+fs-eire@users.noreply.github.com> Date: Thu, 19 Dec 2024 20:51:22 -0800 Subject: [PATCH] fix webgpu delay load macro --- onnxruntime/core/dll/delay_load_hook.cc | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/onnxruntime/core/dll/delay_load_hook.cc b/onnxruntime/core/dll/delay_load_hook.cc index 23fc8bca7368e..79f1c8cffd115 100644 --- a/onnxruntime/core/dll/delay_load_hook.cc +++ b/onnxruntime/core/dll/delay_load_hook.cc @@ -24,8 +24,16 @@ // - both USE_WEBGPU and BUILD_DAWN_MONOLITHIC_LIBRARY are defined // - USE_DML is defined // -#define ORT_DELAY_LOAD_WEBGPU_DAWN_DLL (defined(USE_WEBGPU) && defined(BUILD_DAWN_MONOLITHIC_LIBRARY)) -#define ORT_DELAY_LOAD_DIRECTML_DLL defined(USE_DML) +#if defined(USE_WEBGPU) && defined(BUILD_DAWN_MONOLITHIC_LIBRARY) +#define ORT_DELAY_LOAD_WEBGPU_DAWN_DLL 1 +#else +#define ORT_DELAY_LOAD_WEBGPU_DAWN_DLL 0 +#endif +#if defined(USE_DML) +#define ORT_DELAY_LOAD_DIRECTML_DLL 1 +#else +#define ORT_DELAY_LOAD_DIRECTML_DLL 0 +#endif #if defined(_MSC_VER) && (ORT_DELAY_LOAD_WEBGPU_DAWN_DLL || ORT_DELAY_LOAD_DIRECTML_DLL) #include