1be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet#
2be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet# Copyright (C) 2015 The Android Open Source Project
3be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet#
4be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet# Licensed under the Apache License, Version 2.0 (the "License");
5be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet# you may not use this file except in compliance with the License.
6be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet# You may obtain a copy of the License at
7be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet#
8be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet#      http://www.apache.org/licenses/LICENSE-2.0
9be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet#
10be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet# Unless required by applicable law or agreed to in writing, software
11be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet# distributed under the License is distributed on an "AS IS" BASIS,
12be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet# See the License for the specific language governing permissions and
14be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet# limitations under the License.
15be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet#
16be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet
17be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletheader:
1820b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouilletsummary: Input/Output Functions
19be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletdescription:
2020b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouillet These functions are used to:<ul>
2120b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouillet <li>Send information to the Java client, and</li>
2220b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouillet#TODO We need better documentation for:
2320b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouillet <li>Send the processed allocation or receive the next allocation to process.</li></ul>
24be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletend:
25be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet
26be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletfunction: rsAllocationIoReceive
27be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletversion: 16
28be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletret: void
2920b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouilletarg: rs_allocation a, "Allocation to work on."
30be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletsummary: Receive new content from the queue
31be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletdescription:
32be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet Receive a new set of contents from the queue.
3320b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouillet#TODO We need better documentation.
34f05e4aff0c76943ffaf7a2f2ae653373e6f6384fYang Ni
35f05e4aff0c76943ffaf7a2f2ae653373e6f6384fYang Ni This function should not be called from inside a kernel, or from any function
36f05e4aff0c76943ffaf7a2f2ae653373e6f6384fYang Ni that may be called directly or indirectly from a kernel. Doing so would cause a
37f05e4aff0c76943ffaf7a2f2ae653373e6f6384fYang Ni runtime error.
38be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillettest: none
39be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletend:
40be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet
41be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletfunction: rsAllocationIoSend
42be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletversion: 16
43be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletret: void
4420b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouilletarg: rs_allocation a, "Allocation to work on."
45be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletsummary: Send new content to the queue
46be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletdescription:
47be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet Send the contents of the Allocation to the queue.
4820b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouillet#TODO We need better documentation.
49f05e4aff0c76943ffaf7a2f2ae653373e6f6384fYang Ni
50f05e4aff0c76943ffaf7a2f2ae653373e6f6384fYang Ni This function should not be called from inside a kernel, or from any function
51f05e4aff0c76943ffaf7a2f2ae653373e6f6384fYang Ni that may be called directly or indirectly from a kernel. Doing so would cause a
52f05e4aff0c76943ffaf7a2f2ae653373e6f6384fYang Ni runtime error.
53be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillettest: none
54be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletend:
55be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet
56be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletfunction: rsSendToClient
57be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletret: bool
58be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletarg: int cmdID
5920b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouilletsummary: Send a message to the client, non-blocking
60be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletdescription:
6120b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouillet Sends a message back to the client.  This call does not block.
6220b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouillet It returns true if the message was sent and false if the
6320b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouillet message queue is full.
6420b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouillet
6520b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouillet A message ID is required.  The data payload is optional.
6620b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouillet
6720b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouillet See <a href='http://developer.android.com/reference/android/renderscript/RenderScript.RSMessageHandler.html'>RenderScript.RSMessageHandler</a>.
68be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillettest: none
69be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletend:
70be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet
71be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletfunction: rsSendToClient
72be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletret: bool
73be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletarg: int cmdID
7420b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouilletarg: const void* data, "Application specific data."
7520b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouilletarg: uint len, "Length of the data, in bytes."
76be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillettest: none
77be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletend:
78be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet
79be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletfunction: rsSendToClientBlocking
80be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletret: void
81be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletarg: int cmdID
8220b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouilletsummary: Send a message to the client, blocking
83be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletdescription:
8420b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouillet Sends a message back to the client.  This function will block
8520b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouillet until there is room on the message queue for this message.
8620b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouillet This function may return before the message was delivered and
8720b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouillet processed by the client.
8820b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouillet
8920b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouillet A message ID is required.  The data payload is optional.
9020b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouillet
9120b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouillet See <a href='http://developer.android.com/reference/android/renderscript/RenderScript.RSMessageHandler.html'>RenderScript.RSMessageHandler</a>.
92be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillettest: none
93be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletend:
94be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet
95be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletfunction: rsSendToClientBlocking
96be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletret: void
97be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletarg: int cmdID
9820b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouilletarg: const void* data, "Application specific data."
9920b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouilletarg: uint len, "Length of the data, in bytes."
100be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillettest: none
101be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletend:
102