aboutsummaryrefslogtreecommitdiff
path: root/pseudocode/library/variable_tensor_allocate.tosac
diff options
context:
space:
mode:
authorKevin Petit <kevin.petit@arm.com>2024-01-31 10:24:14 +0000
committerEric Kunze <eric.kunze@arm.com>2024-02-06 21:31:27 +0000
commitc65cd9ccff6000be01ee0742319009f0061879ce (patch)
tree726ac4d8e85ad8e46e5240ff0f026eb99589dbd5 /pseudocode/library/variable_tensor_allocate.tosac
parent6bf50e8706a6969e6a25be6b2638e81ad21489e7 (diff)
downloadspecification-c65cd9ccff6000be01ee0742319009f0061879ce.tar.gz
pseudocode: move all helpers to separate files
Change-Id: I75ea94d42c63e862af8e492da7f47ecd6caa1055 Signed-off-by: Kevin Petit <kevin.petit@arm.com>
Diffstat (limited to 'pseudocode/library/variable_tensor_allocate.tosac')
-rw-r--r--pseudocode/library/variable_tensor_allocate.tosac19
1 files changed, 19 insertions, 0 deletions
diff --git a/pseudocode/library/variable_tensor_allocate.tosac b/pseudocode/library/variable_tensor_allocate.tosac
new file mode 100644
index 0000000..4ac83e7
--- /dev/null
+++ b/pseudocode/library/variable_tensor_allocate.tosac
@@ -0,0 +1,19 @@
+//
+// This confidential and proprietary software may be used only as
+// authorised by a licensing agreement from ARM Limited
+// (C) COPYRIGHT 2020-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.
+
+tensor_t* variable_tensor_allocate<in_t>(shape_t shape, int32_t uid) {
+ size_t size = tensor_size(shape);
+ tensor_t *allocated_tensor = new tensor_t;
+ allocated_tensor->data = new in_t[size];
+ allocated_tensor->uid = uid;
+ allocated_tensor->is_written = false;
+ allocated_tensor->shape = shape;
+ allocated_tensor->type = in_t;
+ return allocated_tensor;
+}