aboutsummaryrefslogtreecommitdiff
path: root/chapters/variable.adoc
blob: 8522f5e4c53410336863e2cc9fc5f68822b1a0f8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
//
// This confidential and proprietary software may be used only as
// authorised by a licensing agreement from ARM Limited
// (C) COPYRIGHT 2023-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.

=== Variable Operators

TOSA implements three variable operators for expressing persistent mutable values across multiple TOSA graph invocations.

==== VARIABLE

Defines a new TOSA variable.
This is a persistent mutable value across multiple TOSA graph invocations.
Modifications are expressed using read/write semantics.

include::{generated}/operators/VARIABLE.adoc[]

[source,c++]
----
include::{pseudocode}/operators/VARIABLE.tosac[lines=10..-1]
----

==== VARIABLE_WRITE

Assigns a value to the pseudo-buffer resource holding a persistent mutable tensor.

include::{generated}/operators/VARIABLE_WRITE.adoc[]

[source,c++]
----
include::{pseudocode}/operators/VARIABLE_WRITE.tosac[lines=10..-1]
----

==== VARIABLE_READ

Reads the value from a pseudo-buffer resource holding a persistent mutable tensor.

include::{generated}/operators/VARIABLE_READ.adoc[]

[source,c++]
----
include::{pseudocode}/operators/VARIABLE_READ.tosac[lines=10..-1]
----