aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Kunze <eric.kunze@arm.com>2023-07-11 14:10:44 -0700
committerEric Kunze <eric.kunze@arm.com>2023-08-18 10:03:35 -0700
commit633a3d9f5caab42da4d25d4ed6b7f8706327a42e (patch)
treeac1d836f525b18a5ba5f641afe40115b2b49f529
parentfb0284e2912bd5fd73bf6f476901490e04c330a2 (diff)
downloadspecification-633a3d9f5caab42da4d25d4ed6b7f8706327a42e.tar.gz
Update Custom operator arguments
CUSTOM operators are still implementation specific, but now have attributes added to identify and namespace the underyling operation. Signed-off-by: Eric Kunze <eric.kunze@arm.com> Change-Id: I8db2fffd0b34958bd8c718633a130941f32f962b
-rw-r--r--chapters/custom.adoc18
-rw-r--r--tools/dictionary.dic1
-rw-r--r--tosa.xml24
-rw-r--r--tosa.xsd1
4 files changed, 38 insertions, 6 deletions
diff --git a/chapters/custom.adoc b/chapters/custom.adoc
index e748f38..cf99bc4 100644
--- a/chapters/custom.adoc
+++ b/chapters/custom.adoc
@@ -1,7 +1,7 @@
//
// This confidential and proprietary software may be used only as
// authorised by a licensing agreement from ARM Limited
-// (C) COPYRIGHT 2020 ARM Limited
+// (C) COPYRIGHT 2020,2023 ARM Limited
// ALL RIGHTS RESERVED
// The entire notice above must be reproduced on all authorised
// copies and copies may only be made to the extent permitted
@@ -12,9 +12,15 @@
Hardware implementing TOSA may choose to add additional custom operators that are not expressed in the existing TOSA operations. These operators are not expected to be portable across TOSA implementations. The input and output signatures must be expressed in the corresponding TOSA node.
==== CUSTOM
-Input arguments:
-* Num input arguments – Scalar number of input arguments
-* Num output arguments – Scalar number of output arguments
-* Operator code – untyped data consisting of the operator data
-* Affine transform description for each tensor
+Runs an implementation defined custom operator.
+CUSTOM operators are not tested in the conformance suite as results will be implementation defined.
+The `domain` attribute should be unique to each implementation.
+To achieve this, using a domain name as the `domain` attribute is recommended.
+
+include::{generated}/operators/CUSTOM.adoc[]
+
+[source,c++]
+----
+// Implementation defined behavior
+---- \ No newline at end of file
diff --git a/tools/dictionary.dic b/tools/dictionary.dic
index faf431a..6b83c53 100644
--- a/tools/dictionary.dic
+++ b/tools/dictionary.dic
@@ -14,6 +14,7 @@ CLZ
concat
CONCAT
COND
+config
conformant
const
CONST
diff --git a/tosa.xml b/tosa.xml
index b5a5f7a..8cf9fce 100644
--- a/tosa.xml
+++ b/tosa.xml
@@ -2596,6 +2596,30 @@ used.</description>
</typesupport>
</operator>
</operatorgroup>
+ <operatorgroup name="custom">
+ <operator>
+ <name>CUSTOM</name>
+ <arguments>
+ <argument category="input" name="input_list" type="tensor_list_t" shape="-" tensor-element-type="-">
+ <description>List of input tensors</description>
+ </argument>
+ <argument category="attribute" name="operator" type="String" shape="-" tensor-element-type="-">
+ <description>String which tells the backend which custom operator is being called</description>
+ </argument>
+ <argument category="attribute" name="domain" type="String" shape="-" tensor-element-type="-">
+ <description>String idenifier which can help avoid name collisions on the operator field.
+ Different implementations of a given operator would be in different domains.
+ Implementations can choose which domains they want to support.</description>
+ </argument>
+ <argument category="attribute" name="implementation_attrs" type="String" shape="-" tensor-element-type="-">
+ <description>String value containing implementation specific attributes which apply to the operation</description>
+ </argument>
+ <argument category="output" name="output_list" type="tensor_list_t" shape="-" tensor-element-type="-">
+ <description>List of output tensors</description>
+ </argument>
+ </arguments>
+ </operator>
+ </operatorgroup>
<operatorgroup name="control-flow">
<operator>
<name>COND_IF</name>
diff --git a/tosa.xsd b/tosa.xsd
index 8a3c307..c4af523 100644
--- a/tosa.xsd
+++ b/tosa.xsd
@@ -82,6 +82,7 @@
<xs:enumeration value="tensor_t"/>
<xs:enumeration value="tensor_list_t"/>
<xs:enumeration value="tosa_graph_t"/>
+ <xs:enumeration value="String"/>
</xs:restriction>
</xs:simpleType>