Eric Kunze | e5e2676 | 2020-10-13 16:11:07 -0700 | [diff] [blame] | 1 | |
Jerry Ge | 5637a86 | 2023-10-30 10:18:45 -0700 | [diff] [blame] | 2 | // Copyright (c) 2020, 2023 ARM Limited. |
Eric Kunze | e5e2676 | 2020-10-13 16:11:07 -0700 | [diff] [blame] | 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 | #ifndef OPS_CUSTOM_H |
| 17 | #define OPS_CUSTOM_H |
| 18 | |
Jerry Ge | 5637a86 | 2023-10-30 10:18:45 -0700 | [diff] [blame] | 19 | #include "attribute.h" |
| 20 | #include "custom_registry.h" |
Eric Kunze | e5e2676 | 2020-10-13 16:11:07 -0700 | [diff] [blame] | 21 | #include "graph_node.h" |
| 22 | |
| 23 | using namespace tosa; |
| 24 | |
| 25 | namespace TosaReference |
| 26 | { |
Eric Kunze | e5e2676 | 2020-10-13 16:11:07 -0700 | [diff] [blame] | 27 | class OpCustom : public GraphNode |
| 28 | { |
| 29 | public: |
Jerry Ge | 5637a86 | 2023-10-30 10:18:45 -0700 | [diff] [blame] | 30 | OpCustom(SubgraphTraverser* sgt_, TosaAttributeBase* attribute_, uint64_t id_); |
| 31 | ~OpCustom(); |
Eric Kunze | e5e2676 | 2020-10-13 16:11:07 -0700 | [diff] [blame] | 32 | |
Jerry Ge | 5637a86 | 2023-10-30 10:18:45 -0700 | [diff] [blame] | 33 | int checkTensorAttributes(); |
| 34 | int eval(); |
| 35 | |
| 36 | protected: |
| 37 | TosaCustomAttribute* attribute; |
| 38 | |
| 39 | private: |
| 40 | CustomOpInterface* custom_op_ptr; |
Eric Kunze | e5e2676 | 2020-10-13 16:11:07 -0700 | [diff] [blame] | 41 | }; |
Eric Kunze | e5e2676 | 2020-10-13 16:11:07 -0700 | [diff] [blame] | 42 | }; // namespace TosaReference |
| 43 | |
| 44 | #endif |