|
10 | 10 | #include <executorch/backends/webgpu/runtime/ops/OperatorRegistry.h> |
11 | 11 |
|
12 | 12 | #include <executorch/backends/vulkan/serialization/schema_generated.h> |
13 | | -#include <executorch/runtime/core/named_data_map.h> |
14 | 13 |
|
15 | 14 | #include <executorch/backends/webgpu/runtime/WebGPUDevice.h> |
16 | 15 | #include <webgpu/wgpu.h> |
@@ -94,8 +93,7 @@ WebGPUGraph::~WebGPUGraph() { |
94 | 93 |
|
95 | 94 | void WebGPUGraph::build( |
96 | 95 | const void* flatbuffer_data, |
97 | | - const uint8_t* constant_data, |
98 | | - const executorch::runtime::NamedDataMap* named_data_map) { |
| 96 | + const uint8_t* constant_data) { |
99 | 97 | if (!device_) { |
100 | 98 | auto* ctx = get_default_webgpu_context(); |
101 | 99 | if (ctx) { |
@@ -167,31 +165,6 @@ void WebGPUGraph::build( |
167 | 165 | const uint8_t* src = constant_data + vk_bytes->offset(); |
168 | 166 | wgpuQueueWriteBuffer( |
169 | 167 | queue_, tensor.buffer, 0, src, tensor.nbytes); |
170 | | - } else if ( |
171 | | - vk_bytes->named_key() != nullptr && |
172 | | - named_data_map != nullptr) { |
173 | | - // Constant stored in the PTE named-data map. |
174 | | - auto buf = |
175 | | - named_data_map->get_data(vk_bytes->named_key()->c_str()); |
176 | | - if (!buf.ok()) { |
177 | | - throw std::runtime_error( |
178 | | - std::string("WebGPU: named constant '") + |
179 | | - vk_bytes->named_key()->c_str() + |
180 | | - "' not found in NamedDataMap"); |
181 | | - } |
182 | | - if (buf->size() < tensor.nbytes) { |
183 | | - throw std::runtime_error( |
184 | | - std::string("WebGPU: named constant '") + |
185 | | - vk_bytes->named_key()->c_str() + "' undersized: have " + |
186 | | - std::to_string(buf->size()) + " bytes, need " + |
187 | | - std::to_string(tensor.nbytes)); |
188 | | - } |
189 | | - wgpuQueueWriteBuffer( |
190 | | - queue_, tensor.buffer, 0, buf->data(), tensor.nbytes); |
191 | | - buf->Free(); |
192 | | - } else { |
193 | | - throw std::runtime_error( |
194 | | - "WebGPU: constant has no inline offset and no named-data key"); |
195 | 168 | } |
196 | 169 | } |
197 | 170 | } |
|
0 commit comments