forked from microsoft/onnxruntime
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/fs-eire/webgpu-ep' into webgpu-e…
…p-gather
- Loading branch information
Showing
26 changed files
with
612 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
diff --git a/src/dawn/native/CMakeLists.txt b/src/dawn/native/CMakeLists.txt | ||
index 9c0bd6fa4e..bf8a57aeac 100644 | ||
--- a/src/dawn/native/CMakeLists.txt | ||
+++ b/src/dawn/native/CMakeLists.txt | ||
@@ -857,6 +857,11 @@ if (DAWN_ENABLE_SWIFTSHADER) | ||
target_compile_definitions(dawn_native PRIVATE "DAWN_ENABLE_SWIFTSHADER") | ||
endif() | ||
|
||
+if (IOS) | ||
+ target_compile_options(dawn_native_objects PRIVATE -fno-objc-arc) | ||
+ target_compile_options(dawn_native PRIVATE -fno-objc-arc) | ||
+endif() | ||
+ | ||
if (DAWN_BUILD_MONOLITHIC_LIBRARY) | ||
############################################################################### | ||
# Do the 'complete_lib' build. | ||
diff --git a/src/dawn/native/Surface_metal.mm b/src/dawn/native/Surface_metal.mm | ||
index ce55acbd43..baa4835362 100644 | ||
--- a/src/dawn/native/Surface_metal.mm | ||
+++ b/src/dawn/native/Surface_metal.mm | ||
@@ -36,7 +36,13 @@ | ||
namespace dawn::native { | ||
|
||
bool InheritsFromCAMetalLayer(void* obj) { | ||
- id<NSObject> object = static_cast<id>(obj); | ||
+ id<NSObject> object = | ||
+#if TARGET_OS_IOS | ||
+ (__bridge id)obj; | ||
+#else | ||
+ static_cast<id>(obj); | ||
+#endif | ||
+ | ||
return [object isKindOfClass:[CAMetalLayer class]]; | ||
} | ||
|
||
diff --git a/src/dawn/native/metal/SharedFenceMTL.mm b/src/dawn/native/metal/SharedFenceMTL.mm | ||
index bde8bfea07..f2f6459e91 100644 | ||
--- a/src/dawn/native/metal/SharedFenceMTL.mm | ||
+++ b/src/dawn/native/metal/SharedFenceMTL.mm | ||
@@ -40,7 +40,13 @@ ResultOrError<Ref<SharedFence>> SharedFence::Create( | ||
DAWN_INVALID_IF(descriptor->sharedEvent == nullptr, "MTLSharedEvent is missing."); | ||
if (@available(macOS 10.14, iOS 12.0, *)) { | ||
return AcquireRef(new SharedFence( | ||
- device, label, static_cast<id<MTLSharedEvent>>(descriptor->sharedEvent))); | ||
+ device, label, | ||
+#if TARGET_OS_IOS | ||
+ (__bridge id<MTLSharedEvent>)(descriptor->sharedEvent) | ||
+#else | ||
+ static_cast<id<MTLSharedEvent>>(descriptor->sharedEvent) | ||
+#endif | ||
+ )); | ||
} else { | ||
return DAWN_INTERNAL_ERROR("MTLSharedEvent not supported."); | ||
} | ||
diff --git a/src/tint/api/BUILD.cmake b/src/tint/api/BUILD.cmake | ||
index 0037d83276..6372c4ee77 100644 | ||
--- a/src/tint/api/BUILD.cmake | ||
+++ b/src/tint/api/BUILD.cmake | ||
@@ -57,6 +57,7 @@ tint_target_add_dependencies(tint_api lib | ||
tint_lang_wgsl_ast_transform | ||
tint_lang_wgsl_common | ||
tint_lang_wgsl_features | ||
+ tint_lang_wgsl_inspector | ||
tint_lang_wgsl_program | ||
tint_lang_wgsl_sem | ||
tint_lang_wgsl_writer_ir_to_program |
14 changes: 14 additions & 0 deletions
14
include/onnxruntime/core/providers/webgpu/webgpu_provider_factory.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
|
||
// Dummy file to provide a signal in the ONNX Runtime C cocoapod as to whether the WebGPU EP was included in the build. | ||
// If it was, this file will be included in the cocoapod, and a test like this can be used: | ||
// | ||
// #if __has_include(<onnxruntime/webgpu_provider_factory.h>) | ||
// #define WEBGPU_EP_AVAILABLE 1 | ||
// #else | ||
// #define WEBGPU_EP_AVAILABLE 0 | ||
// #endif | ||
|
||
// The WebGPU EP can be enabled via the generic SessionOptionsAppendExecutionProvider method, so no direct usage of | ||
// the provider factory is required. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.