aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Petit <kevin.petit@arm.com>2023-03-17 17:12:30 +0000
committerEric Kunze <eric.kunze@arm.com>2023-03-17 19:09:09 +0000
commit18548921437ef60e5553a75517449918e5c42b1d (patch)
treebe03097745e85b17948a3319a5fadfb6176bbf4d
parent6305460ee2a08bc48feae7fa46f025d87057d8f0 (diff)
downloadspecification-18548921437ef60e5553a75517449918e5c42b1d.tar.gz
SCATTER/GATHER: Replace value_t with in_out_t
Most operators use in_out_t. This removes a special case. Signed-off-by: Kevin Petit <kevin.petit@arm.com> Change-Id: Icfc86f1101d250700677959949bda466519152de
-rw-r--r--chapters/scatter_gather.adoc12
-rw-r--r--tosa.xml38
-rw-r--r--tosa.xsd2
3 files changed, 25 insertions, 27 deletions
diff --git a/chapters/scatter_gather.adoc b/chapters/scatter_gather.adoc
index 89942f2..1dbda4f 100644
--- a/chapters/scatter_gather.adoc
+++ b/chapters/scatter_gather.adoc
@@ -21,8 +21,8 @@ include::{generated}/operators/GATHER.adoc[]
for_each(0 <= n < N, 0 <= w < W, 0 <= c < C) {
index_t k = tensor_read<index_t>(indices, [N,W], [n,w]);
REQUIRE(0 <= k && k < K);
- value_t value = tensor_read<value_t>(values, [N,K,C], [n,k,c]);
- tensor_write<value_t>(output, [N,W,C], [n,w,c], value);
+ in_out_t value = tensor_read<in_out_t>(values, [N,K,C], [n,k,c]);
+ tensor_write<in_out_t>(output, [N,W,C], [n,w,c], value);
}
----
@@ -45,8 +45,8 @@ bool_t output_modified[N,K,C];
// Copy the values_in tensor to the values_out tensor.
// Values not written by the scatter operation are unchanged in the output.
for_each(0 <= n < N, 0 <= k < K, 0 <= c < C) {
- value_t value = tensor_read<value_t>(values_in, [N,K,C], [n,k,c]);
- tensor_write<value_t>(values_out, [N,K,C], [n, k, c], value);
+ in_out_t value = tensor_read<in_out_t>(values_in, [N,K,C], [n,k,c]);
+ tensor_write<in_out_t>(values_out, [N,K,C], [n, k, c], value);
output_modified[n,k,c]=false;
}
@@ -55,8 +55,8 @@ for_each(0 <= n < N, 0 <= w < W, 0 <= c < C) {
index_t k = tensor_read<index_t>(indices, [N,W], [n,w]);
REQUIRE(0 <= k && k < K);
REQUIRE(output_modified[n,k,c] == false);
- value_t value = tensor_read<value_t>(input, [N,W,C], [n,w,c]);
- tensor_write<value_t>(values_out, [N,K,C], [n, k, c], value);
+ in_out_t value = tensor_read<in_out_t>(input, [N,W,C], [n,w,c]);
+ tensor_write<in_out_t>(values_out, [N,K,C], [n, k, c], value);
output_modified[n,k,c] = true;
}
----
diff --git a/tosa.xml b/tosa.xml
index dbf1604..00012ad 100644
--- a/tosa.xml
+++ b/tosa.xml
@@ -1892,31 +1892,31 @@ used.</description>
<operator>
<name>GATHER</name>
<arguments>
- <argument category="input" name="values" type="value_t*" shape="[N,K,C]">
+ <argument category="input" name="values" type="in_out_t*" shape="[N,K,C]">
<description>3D value tensor</description>
</argument>
<argument category="input" name="indices" type="index_t*" shape="[N,W]">
<description>2D index tensor</description>
</argument>
- <argument category="output" name="output" type="value_t*" shape="[N,W,C]">
+ <argument category="output" name="output" type="in_out_t*" shape="[N,W,C]">
<description>3D output tensor</description>
</argument>
</arguments>
<types>
- <type name='value_t'/>
+ <type name='in_out_t'/>
</types>
- <typesupport mode="signed 8" value_t="int8_t"/>
- <typesupport mode="signed 16" value_t="int16_t"/>
- <typesupport mode="signed 32" value_t="int32_t"/>
- <typesupport mode="fp16" value_t="fp16_t">
+ <typesupport mode="signed 8" in_out_t="int8_t"/>
+ <typesupport mode="signed 16" in_out_t="int16_t"/>
+ <typesupport mode="signed 32" in_out_t="int32_t"/>
+ <typesupport mode="fp16" in_out_t="fp16_t">
<profile name="MI"/>
<profile name="MT"/>
</typesupport>
- <typesupport mode="bf16" value_t="bf16_t">
+ <typesupport mode="bf16" in_out_t="bf16_t">
<profile name="MI"/>
<profile name="MT"/>
</typesupport>
- <typesupport mode="fp32" value_t="fp32_t">
+ <typesupport mode="fp32" in_out_t="fp32_t">
<profile name="MI"/>
<profile name="MT"/>
</typesupport>
@@ -1924,34 +1924,34 @@ used.</description>
<operator>
<name>SCATTER</name>
<arguments>
- <argument category="input" name="values_in" type="value_t*" shape="[N,K,C]">
+ <argument category="input" name="values_in" type="in_out_t*" shape="[N,K,C]">
<description>3D values in tensor</description>
</argument>
<argument category="input" name="indices" type="index_t*" shape="[N,W]">
<description>2D index tensor</description>
</argument>
- <argument category="input" name="input" type="value_t*" shape="[N,W,C]">
+ <argument category="input" name="input" type="in_out_t*" shape="[N,W,C]">
<description>3D input tensor</description>
</argument>
- <argument category="output" name="values_out" type="value_t*" shape="[N,K,C]">
+ <argument category="output" name="values_out" type="in_out_t*" shape="[N,K,C]">
<description>3D output tensor</description>
</argument>
</arguments>
<types>
- <type name='value_t'/>
+ <type name='in_out_t'/>
</types>
- <typesupport mode="signed 8" value_t="int8_t"/>
- <typesupport mode="signed 16" value_t="int16_t"/>
- <typesupport mode="signed 32" value_t="int32_t"/>
- <typesupport mode="fp16" value_t="fp16_t">
+ <typesupport mode="signed 8" in_out_t="int8_t"/>
+ <typesupport mode="signed 16" in_out_t="int16_t"/>
+ <typesupport mode="signed 32" in_out_t="int32_t"/>
+ <typesupport mode="fp16" in_out_t="fp16_t">
<profile name="MI"/>
<profile name="MT"/>
</typesupport>
- <typesupport mode="bf16" value_t="bf16_t">
+ <typesupport mode="bf16" in_out_t="bf16_t">
<profile name="MI"/>
<profile name="MT"/>
</typesupport>
- <typesupport mode="fp32" value_t="fp32_t">
+ <typesupport mode="fp32" in_out_t="fp32_t">
<profile name="MI"/>
<profile name="MT"/>
</typesupport>
diff --git a/tosa.xsd b/tosa.xsd
index 6f0d3b5..7bf2c40 100644
--- a/tosa.xsd
+++ b/tosa.xsd
@@ -51,7 +51,6 @@
<xs:enumeration value="acc_t"/>
<xs:enumeration value="weight_t"/>
<xs:enumeration value="resize_t"/>
- <xs:enumeration value="value_t"/>
<xs:enumeration value="table_t"/>
<xs:enumeration value="TABLE_SIZE"/>
</xs:restriction>
@@ -174,7 +173,6 @@
<xs:attribute name="weight_t" type="datatype"/>
<xs:attribute name="acc_t" type="datatype"/>
<xs:attribute name="resize_t" type="datatype"/>
- <xs:attribute name="value_t" type="datatype"/>
<xs:attribute name="table_t" type="datatype"/>
<xs:attribute name="TABLE_SIZE" type="xs:int"/>
</xs:complexType>