Skip to content

Commit 25afae7

Browse files
committed
ETUnwrap and cpp20 initializer in xnnpack
1 parent 6efe6c3 commit 25afae7

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

backends/xnnpack/runtime/XNNCompiler.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1539,8 +1539,9 @@ Error defineGenericUnaryNode(
15391539
MAYBE_UNUSED(graph); \
15401540
auto graph_node = node->xnode_union_as_XNN##name(); \
15411541
std::pair<float, float> min_max = getOutputMinMax(node); \
1542-
union xnn_unary_params params = { \
1543-
.clamp = {.min = min_max.first, .max = min_max.second}}; \
1542+
union xnn_unary_params params; \
1543+
params.clamp.min = min_max.first; \
1544+
params.clamp.max = min_max.second; \
15441545
return defineGenericUnaryNode( \
15451546
subgraph_ptr, \
15461547
remapped_ids, \

backends/xnnpack/runtime/XNNPACKBackend.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,11 @@ class XnnpackBackend final
8282

8383
auto program_id =
8484
reinterpret_cast<uintptr_t>(context.get_runtime_allocator());
85-
auto workspace = ET_UNWRAP(get_or_create_workspace(program_id));
85+
auto workspace_result = get_or_create_workspace(program_id);
86+
if (!workspace_result.ok()) {
87+
return workspace_result.error();
88+
}
89+
auto workspace = workspace_result.get();
8690

8791
#ifdef ENABLE_XNNPACK_WEIGHTS_CACHE
8892
const std::lock_guard<std::mutex> lock_weight_cache(weights_cache_mutex_);

0 commit comments

Comments
 (0)