blob: 9ba56149f1425f702fa460420cdf3f9a5b23fc05 [file] [log] [blame]
page.title=RenderScript Kernel Invocation Functions and Types
@jd:body
<div class='renderscript'>
<h2>Overview</h2>
<p> The <a href='rs_for_each.html#android_rs:rsForEach'>rsForEach</a>() function can be used to invoke the root kernel of a script.
</p>
<p> The other functions are used to get the characteristics of the invocation of
an executing kernel, like dimensions and current indices. These functions take
a <a href='rs_for_each.html#android_rs:rs_kernel_context'>rs_kernel_context</a> as argument.
</p>
<h2>Summary</h2>
<table class='jd-sumtable'><tbody>
<tr><th colspan='2'>Types</th></tr>
<tr class='alt-color api apilevel-1'>
<td class='jd-linkcol'>
<a href='rs_for_each.html#android_rs:rs_for_each_strategy_t'>rs_for_each_strategy_t</a>
</td>
<td class='jd-descrcol' width='100%'>
Suggested cell processing order
</td>
</tr>
<tr class='alt-color api apilevel-1'>
<td class='jd-linkcol'>
<a href='rs_for_each.html#android_rs:rs_kernel_context'>rs_kernel_context</a>
</td>
<td class='jd-descrcol' width='100%'>
Handle to a kernel invocation context
</td>
</tr>
<tr class='alt-color api apilevel-1'>
<td class='jd-linkcol'>
<a href='rs_for_each.html#android_rs:rs_script_call_t'>rs_script_call_t</a>
</td>
<td class='jd-descrcol' width='100%'>
Cell iteration information
</td>
</tr>
</tbody></table>
<table class='jd-sumtable'><tbody>
<tr><th colspan='2'>Functions</th></tr>
<tr class='alt-color api apilevel-1'>
<td class='jd-linkcol'>
<a href='rs_for_each.html#android_rs:rsForEach'>rsForEach</a>
</td>
<td class='jd-descrcol' width='100%'>
Invoke the root kernel of a script
</td>
</tr>
<tr class='alt-color api apilevel-1'>
<td class='jd-linkcol'>
<a href='rs_for_each.html#android_rs:rsGetArray0'>rsGetArray0</a>
</td>
<td class='jd-descrcol' width='100%'>
Index in the Array0 dimension for the specified kernel context
</td>
</tr>
<tr class='alt-color api apilevel-1'>
<td class='jd-linkcol'>
<a href='rs_for_each.html#android_rs:rsGetArray1'>rsGetArray1</a>
</td>
<td class='jd-descrcol' width='100%'>
Index in the Array1 dimension for the specified kernel context
</td>
</tr>
<tr class='alt-color api apilevel-1'>
<td class='jd-linkcol'>
<a href='rs_for_each.html#android_rs:rsGetArray2'>rsGetArray2</a>
</td>
<td class='jd-descrcol' width='100%'>
Index in the Array2 dimension for the specified kernel context
</td>
</tr>
<tr class='alt-color api apilevel-1'>
<td class='jd-linkcol'>
<a href='rs_for_each.html#android_rs:rsGetArray3'>rsGetArray3</a>
</td>
<td class='jd-descrcol' width='100%'>
Index in the Array3 dimension for the specified kernel context
</td>
</tr>
<tr class='alt-color api apilevel-1'>
<td class='jd-linkcol'>
<a href='rs_for_each.html#android_rs:rsGetDimArray0'>rsGetDimArray0</a>
</td>
<td class='jd-descrcol' width='100%'>
Size of the Array0 dimension for the specified kernel context
</td>
</tr>
<tr class='alt-color api apilevel-1'>
<td class='jd-linkcol'>
<a href='rs_for_each.html#android_rs:rsGetDimArray1'>rsGetDimArray1</a>
</td>
<td class='jd-descrcol' width='100%'>
Size of the Array1 dimension for the specified kernel context
</td>
</tr>
<tr class='alt-color api apilevel-1'>
<td class='jd-linkcol'>
<a href='rs_for_each.html#android_rs:rsGetDimArray2'>rsGetDimArray2</a>
</td>
<td class='jd-descrcol' width='100%'>
Size of the Array2 dimension for the specified kernel context
</td>
</tr>
<tr class='alt-color api apilevel-1'>
<td class='jd-linkcol'>
<a href='rs_for_each.html#android_rs:rsGetDimArray3'>rsGetDimArray3</a>
</td>
<td class='jd-descrcol' width='100%'>
Size of the Array3 dimension for the specified kernel context
</td>
</tr>
<tr class='alt-color api apilevel-1'>
<td class='jd-linkcol'>
<a href='rs_for_each.html#android_rs:rsGetDimHasFaces'>rsGetDimHasFaces</a>
</td>
<td class='jd-descrcol' width='100%'>
Presence of more than one face for the specified kernel context
</td>
</tr>
<tr class='alt-color api apilevel-1'>
<td class='jd-linkcol'>
<a href='rs_for_each.html#android_rs:rsGetDimLod'>rsGetDimLod</a>
</td>
<td class='jd-descrcol' width='100%'>
Number of levels of detail for the specified kernel context
</td>
</tr>
<tr class='alt-color api apilevel-1'>
<td class='jd-linkcol'>
<a href='rs_for_each.html#android_rs:rsGetDimX'>rsGetDimX</a>
</td>
<td class='jd-descrcol' width='100%'>
Size of the X dimension for the specified kernel context
</td>
</tr>
<tr class='alt-color api apilevel-1'>
<td class='jd-linkcol'>
<a href='rs_for_each.html#android_rs:rsGetDimY'>rsGetDimY</a>
</td>
<td class='jd-descrcol' width='100%'>
Size of the Y dimension for the specified kernel context
</td>
</tr>
<tr class='alt-color api apilevel-1'>
<td class='jd-linkcol'>
<a href='rs_for_each.html#android_rs:rsGetDimZ'>rsGetDimZ</a>
</td>
<td class='jd-descrcol' width='100%'>
Size of the Z dimension for the specified kernel context
</td>
</tr>
<tr class='alt-color api apilevel-1'>
<td class='jd-linkcol'>
<a href='rs_for_each.html#android_rs:rsGetFace'>rsGetFace</a>
</td>
<td class='jd-descrcol' width='100%'>
Coordinate of the Face for the specified kernel context
</td>
</tr>
<tr class='alt-color api apilevel-1'>
<td class='jd-linkcol'>
<a href='rs_for_each.html#android_rs:rsGetLod'>rsGetLod</a>
</td>
<td class='jd-descrcol' width='100%'>
Index in the Levels of Detail dimension for the specified kernel context
</td>
</tr>
</tbody></table>
<h2>Types</h2>
<a name='android_rs:rs_for_each_strategy_t'></a>
<div class='jd-details'>
<h4 class='jd-details-title'>
<span class='sympad'>rs_for_each_strategy_t</span>
<span class='normal'>: Suggested cell processing order</span>
</h4>
<div class='jd-details-descr'>
<p>An enum with the following values:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</p>
<table class='jd-tagtable'><tbody>
<tr><th>RS_FOR_EACH_STRATEGY_SERIAL = 0</th><td>Prefer contiguous memory regions.</td></tr>
<tr><th>RS_FOR_EACH_STRATEGY_DONT_CARE = 1</th><td>No prefrences.</td></tr>
<tr><th>RS_FOR_EACH_STRATEGY_DST_LINEAR = 2</th><td>Prefer DST.</td></tr>
<tr><th>RS_FOR_EACH_STRATEGY_TILE_SMALL = 3</th><td>Prefer processing small rectangular regions.</td></tr>
<tr><th>RS_FOR_EACH_STRATEGY_TILE_MEDIUM = 4</th><td>Prefer processing medium rectangular regions.</td></tr>
<tr><th>RS_FOR_EACH_STRATEGY_TILE_LARGE = 5</th><td>Prefer processing large rectangular regions.</td></tr>
</tbody></table><br/>
<p> This type is used to suggest how the invoked kernel should iterate over the cells of the
allocations. This is a hint only. Implementations may not follow the suggestion.
</p>
<p> This specification can help the caching behavior of the running kernel, e.g. the cache
locality when the processing is distributed over multiple cores.
</p>
</div>
</div>
<a name='android_rs:rs_kernel_context'></a>
<div class='jd-details'>
<h4 class='jd-details-title'>
<span class='sympad'>rs_kernel_context</span>
<span class='normal'>: Handle to a kernel invocation context</span>
</h4>
<div class='jd-details-descr'>
<p>A typedef of: const struct rs_kernel_context_t *&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Added in <a href='http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels'>API level 23</a>
</p>
<p> The kernel context contains common characteristics of the allocations being iterated
over, like dimensions. It also contains rarely used indices of the currently processed
cell, like the Array0 index or the current level of detail.
</p>
<p> You can access the kernel context by adding a special parameter named "context" of type
rs_kernel_context to your kernel function. See <a href='rs_for_each.html#android_rs:rsGetDimX'>rsGetDimX</a>() and <a href='rs_for_each.html#android_rs:rsGetArray0'>rsGetArray0</a>() for examples.
</p>
</div>
</div>
<a name='android_rs:rs_script_call_t'></a>
<div class='jd-details'>
<h4 class='jd-details-title'>
<span class='sympad'>rs_script_call_t</span>
<span class='normal'>: Cell iteration information</span>
</h4>
<div class='jd-details-descr'>
<p>A structure with the following fields:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p>
<table class='jd-tagtable'><tbody>
<tr><th>rs_for_each_strategy_t strategy</th><td>Currently ignored. In the future, will be suggested cell iteration strategy.</td></tr>
<tr><th>uint32_t xStart</th><td>Starting index in the X dimension.</td></tr>
<tr><th>uint32_t xEnd</th><td>Ending index (exclusive) in the X dimension.</td></tr>
<tr><th>uint32_t yStart</th><td>Starting index in the Y dimension.</td></tr>
<tr><th>uint32_t yEnd</th><td>Ending index (exclusive) in the Y dimension.</td></tr>
<tr><th>uint32_t zStart</th><td>Starting index in the Z dimension.</td></tr>
<tr><th>uint32_t zEnd</th><td>Ending index (exclusive) in the Z dimension.</td></tr>
<tr><th>uint32_t arrayStart</th><td>Starting index in the Array0 dimension.</td></tr>
<tr><th>uint32_t arrayEnd</th><td>Ending index (exclusive) in the Array0 dimension.</td></tr>
<tr><th>uint32_t array1Start</th><td>Starting index in the Array1 dimension.</td></tr>
<tr><th>uint32_t array1End</th><td>Ending index (exclusive) in the Array1 dimension.</td></tr>
<tr><th>uint32_t array2Start</th><td>Starting index in the Array2 dimension.</td></tr>
<tr><th>uint32_t array2End</th><td>Ending index (exclusive) in the Array2 dimension.</td></tr>
<tr><th>uint32_t array3Start</th><td>Starting index in the Array3 dimension.</td></tr>
<tr><th>uint32_t array3End</th><td>Ending index (exclusive) in the Array3 dimension.</td></tr>
</tbody></table><br/>
<p> This structure is used to provide iteration information to a rsForEach call.
It is currently used to restrict processing to a subset of cells. In future
versions, it will also be used to provide hint on how to best iterate over
the cells.
</p>
<p> The Start fields are inclusive and the End fields are exclusive. E.g. to iterate
over cells 4, 5, 6, and 7 in the X dimension, set xStart to 4 and xEnd to 8.
</p>
</div>
</div>
<h2>Functions</h2>
<a name='android_rs:rsForEach'></a>
<div class='jd-details'>
<h4 class='jd-details-title'>
<span class='sympad'>rsForEach</span>
<span class='normal'>: Invoke the root kernel of a script</span>
</h4>
<div class='jd-details-descr'>
<table class='jd-tagtable'><tbody>
<tr>
<td>void rsForEach(<a href='rs_object_types.html#android_rs:rs_script'>rs_script</a> script, <a href='rs_object_types.html#android_rs:rs_allocation'>rs_allocation</a> input, <a href='rs_object_types.html#android_rs:rs_allocation'>rs_allocation</a> output);
</td>
<td> Added in <a href='http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels'>API level 14</a>
</td>
</tr>
<tr>
<td>void rsForEach(<a href='rs_object_types.html#android_rs:rs_script'>rs_script</a> script, <a href='rs_object_types.html#android_rs:rs_allocation'>rs_allocation</a> input, <a href='rs_object_types.html#android_rs:rs_allocation'>rs_allocation</a> output, const void* usrData);
</td>
<td> Removed from <a href='http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels'>API level 14 and higher</a>
</td>
</tr>
<tr>
<td>void rsForEach(<a href='rs_object_types.html#android_rs:rs_script'>rs_script</a> script, <a href='rs_object_types.html#android_rs:rs_allocation'>rs_allocation</a> input, <a href='rs_object_types.html#android_rs:rs_allocation'>rs_allocation</a> output, const void* usrData, const <a href='rs_for_each.html#android_rs:rs_script_call_t'>rs_script_call_t</a>* sc);
</td>
<td> Removed from <a href='http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels'>API level 14 and higher</a>
</td>
</tr>
<tr>
<td>void rsForEach(<a href='rs_object_types.html#android_rs:rs_script'>rs_script</a> script, <a href='rs_object_types.html#android_rs:rs_allocation'>rs_allocation</a> input, <a href='rs_object_types.html#android_rs:rs_allocation'>rs_allocation</a> output, const void* usrData, <a href='rs_value_types.html#android_rs:size_t'>size_t</a> usrDataLen);
</td>
<td> <a href='http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels'>API level 14 - 20</a>
</td>
</tr>
<tr>
<td>void rsForEach(<a href='rs_object_types.html#android_rs:rs_script'>rs_script</a> script, <a href='rs_object_types.html#android_rs:rs_allocation'>rs_allocation</a> input, <a href='rs_object_types.html#android_rs:rs_allocation'>rs_allocation</a> output, const void* usrData, <a href='rs_value_types.html#android_rs:size_t'>size_t</a> usrDataLen, const <a href='rs_for_each.html#android_rs:rs_script_call_t'>rs_script_call_t</a>* sc);
</td>
<td> <a href='http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels'>API level 14 - 20</a>
</td>
</tr>
</tbody></table>
</div>
<div class='jd-tagdata'> <h5 class='jd-tagtitle'>Parameters</h5>
<table class='jd-tagtable'><tbody>
<tr><th>script</th><td>Script to call.</td></tr>
<tr><th>input</th><td>Allocation to source data from.</td></tr>
<tr><th>output</th><td>Allocation to write date into.</td></tr>
<tr><th>usrData</th><td>User defined data to pass to the script. May be NULL.</td></tr>
<tr><th>sc</th><td>Extra control information used to select a sub-region of the allocation to be processed or suggest a walking strategy. May be NULL.</td></tr>
<tr><th>usrDataLen</th><td>Size of the userData structure. This will be used to perform a shallow copy of the data if necessary.</td></tr>
</tbody></table>
</div>
<div class='jd-tagdata jd-tagdescr'>
<p> Invoke the kernel named "root" of the specified script. Like other kernels, this root()
function will be invoked repeatedly over the cells of the specificed allocation, filling
the output allocation with the results.
</p>
<p> When rsForEach is called, the root script is launched immediately. rsForEach returns
only when the script has completed and the output allocation is ready to use.
</p>
<p> The rs_script argument is typically initialized using a global variable set from Java.
</p>
<p> The kernel can be invoked with just an input allocation or just an output allocation.
This can be done by defining an rs_allocation variable and not initializing it. E.g.<code><br/>
rs_script gCustomScript;<br/>
void specializedProcessing(rs_allocation in) {<br/>
&nbsp;&nbsp;rs_allocation ignoredOut;<br/>
&nbsp;&nbsp;rsForEach(gCustomScript, in, ignoredOut);<br/>
}<br/></code>
</p>
<p> If both input and output allocations are specified, they must have the same dimensions.
</p>
</div>
</div>
<a name='android_rs:rsGetArray0'></a>
<div class='jd-details'>
<h4 class='jd-details-title'>
<span class='sympad'>rsGetArray0</span>
<span class='normal'>: Index in the Array0 dimension for the specified kernel context</span>
</h4>
<div class='jd-details-descr'>
<table class='jd-tagtable'><tbody>
<tr>
<td><a href='rs_value_types.html#android_rs:uint32_t'>uint32_t</a> rsGetArray0(<a href='rs_for_each.html#android_rs:rs_kernel_context'>rs_kernel_context</a> context);
</td>
<td> Added in <a href='http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels'>API level 23</a>
</td>
</tr>
</tbody></table>
</div>
<div class='jd-tagdata jd-tagdescr'>
<p> Returns the index in the Array0 dimension of the cell being processed, as specified
by the supplied kernel context.
</p>
<p> The kernel context contains common characteristics of the allocations being iterated
over and rarely used indices, like the Array0 index.
</p>
<p> You can access the kernel context by adding a special parameter named "context" of
type rs_kernel_context to your kernel function. E.g.<br/>
<code>short RS_KERNEL myKernel(short value, uint32_t x, rs_kernel_context context) {<br/>
&nbsp;&nbsp;// The current index in the common x, y, z dimensions are accessed by<br/>
&nbsp;&nbsp;// adding these variables as arguments. For the more rarely used indices<br/>
&nbsp;&nbsp;// to the other dimensions, extract them from the kernel context:<br/>
&nbsp;&nbsp;uint32_t index_a0 = rsGetArray0(context);<br/>
&nbsp;&nbsp;//...<br/>
}<br/></code>
</p>
<p> This function returns 0 if the Array0 dimension is not present.
</p>
</div>
</div>
<a name='android_rs:rsGetArray1'></a>
<div class='jd-details'>
<h4 class='jd-details-title'>
<span class='sympad'>rsGetArray1</span>
<span class='normal'>: Index in the Array1 dimension for the specified kernel context</span>
</h4>
<div class='jd-details-descr'>
<table class='jd-tagtable'><tbody>
<tr>
<td><a href='rs_value_types.html#android_rs:uint32_t'>uint32_t</a> rsGetArray1(<a href='rs_for_each.html#android_rs:rs_kernel_context'>rs_kernel_context</a> context);
</td>
<td> Added in <a href='http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels'>API level 23</a>
</td>
</tr>
</tbody></table>
</div>
<div class='jd-tagdata jd-tagdescr'>
<p> Returns the index in the Array1 dimension of the cell being processed, as specified
by the supplied kernel context. See <a href='rs_for_each.html#android_rs:rsGetArray0'>rsGetArray0</a>() for an explanation of the context.
</p>
<p> Returns 0 if the Array1 dimension is not present.
</p>
</div>
</div>
<a name='android_rs:rsGetArray2'></a>
<div class='jd-details'>
<h4 class='jd-details-title'>
<span class='sympad'>rsGetArray2</span>
<span class='normal'>: Index in the Array2 dimension for the specified kernel context</span>
</h4>
<div class='jd-details-descr'>
<table class='jd-tagtable'><tbody>
<tr>
<td><a href='rs_value_types.html#android_rs:uint32_t'>uint32_t</a> rsGetArray2(<a href='rs_for_each.html#android_rs:rs_kernel_context'>rs_kernel_context</a> context);
</td>
<td> Added in <a href='http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels'>API level 23</a>
</td>
</tr>
</tbody></table>
</div>
<div class='jd-tagdata jd-tagdescr'>
<p> Returns the index in the Array2 dimension of the cell being processed,
as specified by the supplied kernel context. See <a href='rs_for_each.html#android_rs:rsGetArray0'>rsGetArray0</a>() for an explanation
of the context.
</p>
<p> Returns 0 if the Array2 dimension is not present.
</p>
</div>
</div>
<a name='android_rs:rsGetArray3'></a>
<div class='jd-details'>
<h4 class='jd-details-title'>
<span class='sympad'>rsGetArray3</span>
<span class='normal'>: Index in the Array3 dimension for the specified kernel context</span>
</h4>
<div class='jd-details-descr'>
<table class='jd-tagtable'><tbody>
<tr>
<td><a href='rs_value_types.html#android_rs:uint32_t'>uint32_t</a> rsGetArray3(<a href='rs_for_each.html#android_rs:rs_kernel_context'>rs_kernel_context</a> context);
</td>
<td> Added in <a href='http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels'>API level 23</a>
</td>
</tr>
</tbody></table>
</div>
<div class='jd-tagdata jd-tagdescr'>
<p> Returns the index in the Array3 dimension of the cell being processed, as specified
by the supplied kernel context. See <a href='rs_for_each.html#android_rs:rsGetArray0'>rsGetArray0</a>() for an explanation of the context.
</p>
<p> Returns 0 if the Array3 dimension is not present.
</p>
</div>
</div>
<a name='android_rs:rsGetDimArray0'></a>
<div class='jd-details'>
<h4 class='jd-details-title'>
<span class='sympad'>rsGetDimArray0</span>
<span class='normal'>: Size of the Array0 dimension for the specified kernel context</span>
</h4>
<div class='jd-details-descr'>
<table class='jd-tagtable'><tbody>
<tr>
<td><a href='rs_value_types.html#android_rs:uint32_t'>uint32_t</a> rsGetDimArray0(<a href='rs_for_each.html#android_rs:rs_kernel_context'>rs_kernel_context</a> context);
</td>
<td> Added in <a href='http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels'>API level 23</a>
</td>
</tr>
</tbody></table>
</div>
<div class='jd-tagdata jd-tagdescr'>
<p> Returns the size of the Array0 dimension for the specified kernel context.
See <a href='rs_for_each.html#android_rs:rsGetDimX'>rsGetDimX</a>() for an explanation of the context.
</p>
<p> Returns 0 if the Array0 dimension is not present.
</p>
</div>
</div>
<a name='android_rs:rsGetDimArray1'></a>
<div class='jd-details'>
<h4 class='jd-details-title'>
<span class='sympad'>rsGetDimArray1</span>
<span class='normal'>: Size of the Array1 dimension for the specified kernel context</span>
</h4>
<div class='jd-details-descr'>
<table class='jd-tagtable'><tbody>
<tr>
<td><a href='rs_value_types.html#android_rs:uint32_t'>uint32_t</a> rsGetDimArray1(<a href='rs_for_each.html#android_rs:rs_kernel_context'>rs_kernel_context</a> context);
</td>
<td> Added in <a href='http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels'>API level 23</a>
</td>
</tr>
</tbody></table>
</div>
<div class='jd-tagdata jd-tagdescr'>
<p> Returns the size of the Array1 dimension for the specified kernel context.
See <a href='rs_for_each.html#android_rs:rsGetDimX'>rsGetDimX</a>() for an explanation of the context.
</p>
<p> Returns 0 if the Array1 dimension is not present.
</p>
</div>
</div>
<a name='android_rs:rsGetDimArray2'></a>
<div class='jd-details'>
<h4 class='jd-details-title'>
<span class='sympad'>rsGetDimArray2</span>
<span class='normal'>: Size of the Array2 dimension for the specified kernel context</span>
</h4>
<div class='jd-details-descr'>
<table class='jd-tagtable'><tbody>
<tr>
<td><a href='rs_value_types.html#android_rs:uint32_t'>uint32_t</a> rsGetDimArray2(<a href='rs_for_each.html#android_rs:rs_kernel_context'>rs_kernel_context</a> context);
</td>
<td> Added in <a href='http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels'>API level 23</a>
</td>
</tr>
</tbody></table>
</div>
<div class='jd-tagdata jd-tagdescr'>
<p> Returns the size of the Array2 dimension for the specified kernel context.
See <a href='rs_for_each.html#android_rs:rsGetDimX'>rsGetDimX</a>() for an explanation of the context.
</p>
<p> Returns 0 if the Array2 dimension is not present.
</p>
</div>
</div>
<a name='android_rs:rsGetDimArray3'></a>
<div class='jd-details'>
<h4 class='jd-details-title'>
<span class='sympad'>rsGetDimArray3</span>
<span class='normal'>: Size of the Array3 dimension for the specified kernel context</span>
</h4>
<div class='jd-details-descr'>
<table class='jd-tagtable'><tbody>
<tr>
<td><a href='rs_value_types.html#android_rs:uint32_t'>uint32_t</a> rsGetDimArray3(<a href='rs_for_each.html#android_rs:rs_kernel_context'>rs_kernel_context</a> context);
</td>
<td> Added in <a href='http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels'>API level 23</a>
</td>
</tr>
</tbody></table>
</div>
<div class='jd-tagdata jd-tagdescr'>
<p> Returns the size of the Array3 dimension for the specified kernel context.
See <a href='rs_for_each.html#android_rs:rsGetDimX'>rsGetDimX</a>() for an explanation of the context.
</p>
<p> Returns 0 if the Array3 dimension is not present.
</p>
</div>
</div>
<a name='android_rs:rsGetDimHasFaces'></a>
<div class='jd-details'>
<h4 class='jd-details-title'>
<span class='sympad'>rsGetDimHasFaces</span>
<span class='normal'>: Presence of more than one face for the specified kernel context</span>
</h4>
<div class='jd-details-descr'>
<table class='jd-tagtable'><tbody>
<tr>
<td>bool rsGetDimHasFaces(<a href='rs_for_each.html#android_rs:rs_kernel_context'>rs_kernel_context</a> context);
</td>
<td> Added in <a href='http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels'>API level 23</a>
</td>
</tr>
</tbody></table>
</div>
<div class='jd-tagdata'> <h5 class='jd-tagtitle'>Returns</h5>
<table class='jd-tagtable'><tbody>
<tr><td>Returns true if more than one face is present, false otherwise.</td></tr>
</tbody></table>
</div>
<div class='jd-tagdata jd-tagdescr'>
<p> If the kernel is iterating over a cubemap, this function returns true if there's more
than one face present. In all other cases, it returns false. See <a href='rs_for_each.html#android_rs:rsGetDimX'>rsGetDimX</a>() for an
explanation of the context.
</p>
<p> <a href='rs_object_info.html#android_rs:rsAllocationGetDimFaces'>rsAllocationGetDimFaces</a>() is similar but returns 0 or 1 instead of a bool.
</p>
</div>
</div>
<a name='android_rs:rsGetDimLod'></a>
<div class='jd-details'>
<h4 class='jd-details-title'>
<span class='sympad'>rsGetDimLod</span>
<span class='normal'>: Number of levels of detail for the specified kernel context</span>
</h4>
<div class='jd-details-descr'>
<table class='jd-tagtable'><tbody>
<tr>
<td><a href='rs_value_types.html#android_rs:uint32_t'>uint32_t</a> rsGetDimLod(<a href='rs_for_each.html#android_rs:rs_kernel_context'>rs_kernel_context</a> context);
</td>
<td> Added in <a href='http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels'>API level 23</a>
</td>
</tr>
</tbody></table>
</div>
<div class='jd-tagdata jd-tagdescr'>
<p> Returns the number of levels of detail for the specified kernel context. This is useful
for mipmaps. See <a href='rs_for_each.html#android_rs:rsGetDimX'>rsGetDimX</a>() for an explanation of the context.
</p>
<p> Returns 0 if Level of Detail is not used.
</p>
<p> <a href='rs_object_info.html#android_rs:rsAllocationGetDimLOD'>rsAllocationGetDimLOD</a>() is similar but returns 0 or 1 instead the actual
number of levels.
</p>
</div>
</div>
<a name='android_rs:rsGetDimX'></a>
<div class='jd-details'>
<h4 class='jd-details-title'>
<span class='sympad'>rsGetDimX</span>
<span class='normal'>: Size of the X dimension for the specified kernel context</span>
</h4>
<div class='jd-details-descr'>
<table class='jd-tagtable'><tbody>
<tr>
<td><a href='rs_value_types.html#android_rs:uint32_t'>uint32_t</a> rsGetDimX(<a href='rs_for_each.html#android_rs:rs_kernel_context'>rs_kernel_context</a> context);
</td>
<td> Added in <a href='http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels'>API level 23</a>
</td>
</tr>
</tbody></table>
</div>
<div class='jd-tagdata jd-tagdescr'>
<p> Returns the size of the X dimension for the specified kernel context.
</p>
<p> The kernel context contains common characteristics of the allocations being iterated
over and rarely used indices, like the Array0 index.
</p>
<p> You can access it by adding a special parameter named "context" of
type rs_kernel_context to your kernel function. E.g.<br/>
<code>int4 RS_KERNEL myKernel(int4 value, rs_kernel_context context) {<br/>
&nbsp;&nbsp;uint32_t size = rsGetDimX(context); //...<br/></code>
</p>
<p> To get the dimension of specific allocation, use <a href='rs_object_info.html#android_rs:rsAllocationGetDimX'>rsAllocationGetDimX</a>().
</p>
</div>
</div>
<a name='android_rs:rsGetDimY'></a>
<div class='jd-details'>
<h4 class='jd-details-title'>
<span class='sympad'>rsGetDimY</span>
<span class='normal'>: Size of the Y dimension for the specified kernel context</span>
</h4>
<div class='jd-details-descr'>
<table class='jd-tagtable'><tbody>
<tr>
<td><a href='rs_value_types.html#android_rs:uint32_t'>uint32_t</a> rsGetDimY(<a href='rs_for_each.html#android_rs:rs_kernel_context'>rs_kernel_context</a> context);
</td>
<td> Added in <a href='http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels'>API level 23</a>
</td>
</tr>
</tbody></table>
</div>
<div class='jd-tagdata jd-tagdescr'>
<p> Returns the size of the X dimension for the specified kernel context.
See <a href='rs_for_each.html#android_rs:rsGetDimX'>rsGetDimX</a>() for an explanation of the context.
</p>
<p> Returns 0 if the Y dimension is not present.
</p>
<p> To get the dimension of specific allocation, use <a href='rs_object_info.html#android_rs:rsAllocationGetDimY'>rsAllocationGetDimY</a>().
</p>
</div>
</div>
<a name='android_rs:rsGetDimZ'></a>
<div class='jd-details'>
<h4 class='jd-details-title'>
<span class='sympad'>rsGetDimZ</span>
<span class='normal'>: Size of the Z dimension for the specified kernel context</span>
</h4>
<div class='jd-details-descr'>
<table class='jd-tagtable'><tbody>
<tr>
<td><a href='rs_value_types.html#android_rs:uint32_t'>uint32_t</a> rsGetDimZ(<a href='rs_for_each.html#android_rs:rs_kernel_context'>rs_kernel_context</a> context);
</td>
<td> Added in <a href='http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels'>API level 23</a>
</td>
</tr>
</tbody></table>
</div>
<div class='jd-tagdata jd-tagdescr'>
<p> Returns the size of the Z dimension for the specified kernel context.
See <a href='rs_for_each.html#android_rs:rsGetDimX'>rsGetDimX</a>() for an explanation of the context.
</p>
<p> Returns 0 if the Z dimension is not present.
</p>
<p> To get the dimension of specific allocation, use <a href='rs_object_info.html#android_rs:rsAllocationGetDimZ'>rsAllocationGetDimZ</a>().
</p>
</div>
</div>
<a name='android_rs:rsGetFace'></a>
<div class='jd-details'>
<h4 class='jd-details-title'>
<span class='sympad'>rsGetFace</span>
<span class='normal'>: Coordinate of the Face for the specified kernel context</span>
</h4>
<div class='jd-details-descr'>
<table class='jd-tagtable'><tbody>
<tr>
<td><a href='rs_object_types.html#android_rs:rs_allocation_cubemap_face'>rs_allocation_cubemap_face</a> rsGetFace(<a href='rs_for_each.html#android_rs:rs_kernel_context'>rs_kernel_context</a> context);
</td>
<td> Added in <a href='http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels'>API level 23</a>
</td>
</tr>
</tbody></table>
</div>
<div class='jd-tagdata jd-tagdescr'>
<p> Returns the face on which the cell being processed is found, as specified by the
supplied kernel context. See <a href='rs_for_each.html#android_rs:rsGetArray0'>rsGetArray0</a>() for an explanation of the context.
</p>
<p> Returns RS_ALLOCATION_CUBEMAP_FACE_POSITIVE_X if the face dimension is not
present.
</p>
</div>
</div>
<a name='android_rs:rsGetLod'></a>
<div class='jd-details'>
<h4 class='jd-details-title'>
<span class='sympad'>rsGetLod</span>
<span class='normal'>: Index in the Levels of Detail dimension for the specified kernel context</span>
</h4>
<div class='jd-details-descr'>
<table class='jd-tagtable'><tbody>
<tr>
<td><a href='rs_value_types.html#android_rs:uint32_t'>uint32_t</a> rsGetLod(<a href='rs_for_each.html#android_rs:rs_kernel_context'>rs_kernel_context</a> context);
</td>
<td> Added in <a href='http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels'>API level 23</a>
</td>
</tr>
</tbody></table>
</div>
<div class='jd-tagdata jd-tagdescr'>
<p> Returns the index in the Levels of Detail dimension of the cell being processed,
as specified by the supplied kernel context. See <a href='rs_for_each.html#android_rs:rsGetArray0'>rsGetArray0</a>() for an explanation of
the context.
</p>
<p> Returns 0 if the Levels of Detail dimension is not present.
</p>
</div>
</div>
</div>