aboutsummaryrefslogtreecommitdiff
path: root/pseudocode
diff options
context:
space:
mode:
authorEric Kunze <eric.kunze@arm.com>2024-02-13 16:51:17 -0800
committerEric Kunze <eric.kunze@arm.com>2024-02-14 21:17:21 -0800
commit1f05883799957300ea88d7ec314a5897e6c0ccb1 (patch)
treeb4113fd73a80f9e7ac252c057663b2ff39d9eb65 /pseudocode
parent74e2ceba954ed6111b3e3ce40c5ff88fe79ff043 (diff)
downloadspecification-1f05883799957300ea88d7ec314a5897e6c0ccb1.tar.gz
Add SIN/COS to elementwise operator set
Only defined for floating-point types. Signed-off-by: Eric Kunze <eric.kunze@arm.com> Change-Id: Ieae355076f9aac6882fab8530e6d7d9985a6e661
Diffstat (limited to 'pseudocode')
-rw-r--r--pseudocode/operators/COS.tosac14
-rw-r--r--pseudocode/operators/SIN.tosac14
2 files changed, 28 insertions, 0 deletions
diff --git a/pseudocode/operators/COS.tosac b/pseudocode/operators/COS.tosac
new file mode 100644
index 0000000..e1f1d91
--- /dev/null
+++ b/pseudocode/operators/COS.tosac
@@ -0,0 +1,14 @@
+//
+// This confidential and proprietary software may be used only as
+// authorised by a licensing agreement from ARM Limited
+// (C) COPYRIGHT 2024 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
+// by a licensing agreement from ARM Limited.
+
+for_each(index in shape) {
+ in_out_t value1 = tensor_read<in_out_t>(input, shape, index);
+ value = cos<in_out_t>(value1);
+ tensor_write<in_out_t>(output, shape, index, value);
+}
diff --git a/pseudocode/operators/SIN.tosac b/pseudocode/operators/SIN.tosac
new file mode 100644
index 0000000..9a24a00
--- /dev/null
+++ b/pseudocode/operators/SIN.tosac
@@ -0,0 +1,14 @@
+//
+// This confidential and proprietary software may be used only as
+// authorised by a licensing agreement from ARM Limited
+// (C) COPYRIGHT 2024 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
+// by a licensing agreement from ARM Limited.
+
+for_each(index in shape) {
+ in_out_t value1 = tensor_read<in_out_t>(input, shape, index);
+ value = sin<in_out_t>(value1);
+ tensor_write<in_out_t>(output, shape, index, value);
+}