Skip to content

Commit

Permalink
[ET-VK][EZ] Throw in VK_GET_OP_FN if op is not found
Browse files Browse the repository at this point in the history
Make yipjustin happy. Forgot this safeguard when I originally wrote the `OperatorRegistry` class.

Differential Revision: [D56085588](https://our.internmc.facebook.com/intern/diff/D56085588/)

ghstack-source-id: 222384998
Pull Request resolved: #3028
  • Loading branch information
jorgep31415 committed Apr 12, 2024
1 parent 5b7c4ba commit 9b2019b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion backends/vulkan/runtime/graph/ops/OperatorRegistry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ bool OperatorRegistry::has_op(const std::string& name) {

OperatorRegistry::OpFunction& OperatorRegistry::get_op_fn(
const std::string& name) {
return table_.find(name)->second;
const auto it = table_.find(name);
VK_CHECK_COND(it != table_.end(), "Could not find operator with name ", name);
return it->second;
}

void OperatorRegistry::register_op(const std::string& name, OpFunction& fn) {
Expand Down

0 comments on commit 9b2019b

Please sign in to comment.