ONE - On-device Neural Engine
Loading...
Searching...
No Matches
HashtableLookup.cc
Go to the documentation of this file.
1/*
2 * Copyright (c) 2025 Samsung Electronics Co., Ltd. All Rights Reserved
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#include "../KernelGenerator.h"
18#include "../Validator.h"
19
20#include <AclKernelGen.h>
21
23{
24
25void Validator::visit(const ir::operation::HashtableLookup &) { _supported = true; }
26
27void KernelGenerator::visit(const ir::operation::HashtableLookup &node)
28{
29 const auto output_index{node.getOutputs().at(ir::operation::HashtableLookup::Output::OUTPUT)};
30 const auto hits_index{node.getOutputs().at(ir::operation::HashtableLookup::Output::HITS)};
31
32 const auto lookups_index{node.getInputs().at(ir::operation::HashtableLookup::Input::LOOKUPS)};
33 const auto keys_index{node.getInputs().at(ir::operation::HashtableLookup::Input::KEYS)};
34 const auto values_index{node.getInputs().at(ir::operation::HashtableLookup::Input::VALUES)};
35
36 auto output_tensor = _tensor_reg->getAclTensor(output_index);
37 auto hits_tensor = _tensor_reg->getAclTensor(hits_index);
38
39 auto lookups_tensor = _tensor_reg->getAclTensor(lookups_index);
40 auto keys_tensor = _tensor_reg->getAclTensor(keys_index);
41 auto values_tensor = _tensor_reg->getAclTensor(values_index);
42
43 auto fn = acl_common::generateLayer<arm_compute::CLHashtableLookup>(
44 lookups_tensor->handle(), keys_tensor->handle(), values_tensor->handle(),
45 output_tensor->handle(), hits_tensor->handle());
46
48}
49
50} // namespace onert::backend::acl_cl
std::unique_ptr< exec::IFunction > _return_fn
std::unique_ptr< AclFunction > asAclFunction(std::unique_ptr<::arm_compute::IFunction > &&layer)
Definition Convert.cc:246