-
Notifications
You must be signed in to change notification settings - Fork 21
/
webnn_wire.json
173 lines (173 loc) · 7.46 KB
/
webnn_wire.json
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
{
"_comment": [
"Copyright 2017 The Dawn Authors",
"Copyright 2021 The WebNN-native Authors",
"",
"Licensed under the Apache License, Version 2.0 (the \"License\");",
"you may not use this file except in compliance with the License.",
"You may obtain a copy of the License at",
"",
" http://www.apache.org/licenses/LICENSE-2.0",
"",
"Unless required by applicable law or agreed to in writing, software",
"distributed under the License is distributed on an \"AS IS\" BASIS,",
"WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.",
"See the License for the specific language governing permissions and",
"limitations under the License."
],
"commands": {
"context pop error scope": [
{"name": "context id", "type": "ObjectId"},
{"name": "request serial", "type": "uint64_t"}
],
"graph builder constant internal": [
{"name": "graph builder id", "type": "ObjectId"},
{"name": "desc", "type": "operand descriptor", "annotation": "const*"},
{"name": "buffer", "type": "uint8_t", "annotation": "const*", "length": "byte length"},
{"name": "byte length", "type": "size_t"},
{"name": "byte offset", "type": "size_t", "default": 0},
{"name": "result", "type": "ObjectHandle", "handle_type": "operand"}
],
"graph builder constant with gpu buffer internal": [
{"name": "graph builder id", "type": "ObjectId"},
{"name": "desc", "type": "operand descriptor", "annotation": "const*"},
{"name": "buffer", "type": "uint8_t", "annotation": "const*", "optional": true},
{"name": "id", "type": "uint32_t", "default": 0},
{"name": "generation", "type": "uint32_t", "default": 0},
{"name": "byte length", "type": "size_t"},
{"name": "byte offset", "type": "size_t", "default": 0},
{"name": "result", "type": "ObjectHandle", "handle_type": "operand"}
],
"graph builder gru internal": [
{"name": "graph builder id", "type": "ObjectId"},
{"name": "input id", "type": "ObjectId"},
{"name": "weight id", "type": "ObjectId"},
{"name": "recurrent weight id", "type": "ObjectId"},
{"name": "steps", "type": "int32_t", "default": 0},
{"name": "hidden size", "type": "int32_t", "default": 0},
{"name": "options", "type": "gru options", "annotation": "const*"},
{"name": "result", "type": "ObjectHandle", "handle_type": "operand array"}
],
"graph builder split internal": [
{"name": "graph builder id", "type": "ObjectId"},
{"name": "input id", "type": "ObjectId"},
{"name": "splits", "type": "uint32_t", "annotation": "const*", "length": "splits count"},
{"name": "splits count", "type": "uint32_t", "default": 0},
{"name": "options", "type": "split options", "annotation": "const*"},
{"name": "result", "type": "ObjectHandle", "handle_type": "operand array"}
],
"instance create context with gpu device internal": [
{"name": "instance id", "type": "ObjectId"},
{"name": "device", "type": "uint8_t", "annotation": "const*", "optional": true},
{"name": "id", "type": "uint32_t", "default": 0},
{"name": "generation", "type": "uint32_t", "default": 0},
{"name": "result", "type": "ObjectHandle", "handle_type": "context"}
],
"graph compute": [
{"name": "graph id", "type": "ObjectId"},
{"name": "inputs id", "type": "ObjectId"},
{"name": "outputs id", "type": "ObjectId"}
],
"graph compute async": [
{ "name": "graph id", "type": "ObjectId" },
{ "name": "request serial", "type": "uint64_t" },
{"name": "inputs id", "type": "ObjectId"},
{"name": "outputs id", "type": "ObjectId"}
],
"operand array size": [
{"name": "operand array id", "type": "ObjectId"}
],
"operator array size": [
{"name": "operator array id", "type": "ObjectId"}
],
"named inputs set": [
{"name": "named inputs id", "type": "ObjectId"},
{"name": "name", "type": "char", "annotation": "const*", "length": "strlen"},
{"name": "buffer", "type": "uint8_t", "annotation": "const*", "length": "byte length", "optional": true},
{"name": "byte length", "type": "size_t"},
{"name": "byte offset", "type": "size_t", "default": 0},
{"name": "gpu buffer id", "type": "uint32_t", "default": 0},
{"name": "gpu buffer generation", "type": "uint32_t", "default": 0},
{"name": "dimensions", "type": "int32_t", "annotation": "const*", "length": "dimensions count", "optional": true},
{"name": "dimensions count", "type": "uint32_t", "default": 0}
],
"named outputs set": [
{"name": "named outputs id", "type": "ObjectId"},
{"name": "name", "type": "char", "annotation": "const*", "length": "strlen"},
{"name": "byte length", "type": "size_t"},
{"name": "byte offset", "type": "size_t", "default": 0},
{"name": "gpu buffer id", "type": "uint32_t", "default": 0},
{"name": "gpu buffer generation", "type": "uint32_t", "default": 0}
],
"destroy object": [
{"name": "object type", "type": "ObjectType"},
{"name": "object id", "type": "ObjectId"}
],
"create graph builder": [
{"name": "context", "type": "ObjectId"},
{"name": "result", "type": "ObjectHandle", "handle_type": "graph builder"}
]
},
"return commands": {
"context pop error scope callback": [
{"name": "context", "type": "ObjectHandle", "handle_type": "context"},
{"name": "request serial", "type": "uint64_t"},
{"name": "type", "type": "error type"},
{"name": "message", "type": "char", "annotation": "const*", "length": "strlen"}
],
"graph compute result": [
{"name": "named outputs", "type": "ObjectHandle", "handle_type": "named outputs"},
{"name": "name", "type": "char", "annotation": "const*", "length": "strlen"},
{"name": "buffer", "type": "uint8_t", "annotation": "const*", "length": "byte length"},
{"name": "byte length", "type": "size_t"},
{"name": "byte offset", "type": "size_t", "default": 0}
],
"graph compute async callback": [
{ "name": "graph", "type": "ObjectHandle", "handle_type": "graph" },
{ "name": "request serial", "type": "uint64_t" },
{ "name": "type", "type": "error type"},
{ "name": "message", "type": "char", "annotation": "const*", "length": "strlen" }
]
},
"special items": {
"client_side_structures": [
"Resource",
"ArrayBufferView",
"GpuBufferView",
"GpuDevice",
"Input"
],
"client_side_commands": [
"ContextPopErrorScope",
"ContextSetUncapturedErrorCallback",
"GraphBuilderConstant",
"GraphBuilderConstantWithGpuBuffer",
"GraphBuilderGru",
"GraphBuilderSplit",
"InstanceCreateContextWithGpuDevice",
"NamedInputsSet",
"NamedOutputsSet",
"NamedOutputsGet",
"OperandArraySize",
"OperatorArraySize",
"GraphComputeAsync",
"GraphCompute"
],
"client_handwritten_commands": [
"ContextPushErrorScope"
],
"client_special_objects": [
"Context",
"Graph",
"GraphBuilder",
"NamedInputs",
"NamedOutputs",
"OperandArray",
"OperatorArray",
"Instance"
],
"server_custom_pre_handler_commands": [],
"server_handwritten_commands": [],
"server_reverse_lookup_objects": []
}
}