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
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
|
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:
</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 * 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: </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/>
rs_allocation ignoredOut;<br/>
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/>
// The current index in the common x, y, z dimensions are accessed by<br/>
// adding these variables as arguments. For the more rarely used indices<br/>
// to the other dimensions, extract them from the kernel context:<br/>
uint32_t index_a0 = rsGetArray0(context);<br/>
//...<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/>
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>
|