1/* 2 * Copyright (C) 2011-2014 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17/* 18 * This file is auto-generated. DO NOT MODIFY! 19 * The source Renderscript file: reflection3264_divergent.rscript 20 */ 21 22package foo; 23 24import android.os.Build; 25import android.os.Process; 26import java.lang.reflect.Field; 27import android.renderscript.*; 28import foo.reflection3264_divergentBitCode; 29 30/** 31 * @hide 32 */ 33public class ScriptC_reflection3264_divergent extends ScriptC { 34 private static final String __rs_resource_name = "reflection3264_divergent"; 35 // Constructor 36 public ScriptC_reflection3264_divergent(RenderScript rs) { 37 super(rs, 38 __rs_resource_name, 39 reflection3264_divergentBitCode.getBitCode32(), 40 reflection3264_divergentBitCode.getBitCode64()); 41 __I32 = Element.I32(rs); 42 __@@INVALID@@ = Element.@@INVALID@@(rs); 43 __ALLOCATION = Element.ALLOCATION(rs); 44 __ScriptField_NonDivergent = ScriptField_NonDivergent.createElement(rs); 45 __ScriptField_Divergent = ScriptField_Divergent.createElement(rs); 46 } 47 48 private Element __@@INVALID@@; 49 private Element __ALLOCATION; 50 private Element __I32; 51 private Element __ScriptField_Divergent; 52 private Element __ScriptField_NonDivergent; 53 private FieldPacker __rs_fp_@@INVALID@@; 54 private FieldPacker __rs_fp_ALLOCATION; 55 private FieldPacker __rs_fp_I32; 56 private FieldPacker __rs_fp_ScriptField_Divergent; 57 private FieldPacker __rs_fp_ScriptField_NonDivergent; 58 private final static int mExportVarIdx_intVar = 0; 59 private int mExportVar_intVar; 60 public synchronized void set_intVar(int v) { 61 setVar(mExportVarIdx_intVar, v); 62 mExportVar_intVar = v; 63 } 64 65 public int get_intVar() { 66 return mExportVar_intVar; 67 } 68 69 public Script.FieldID getFieldID_intVar() { 70 return createFieldID(mExportVarIdx_intVar, null); 71 } 72 73 private final static int mExportVarIdx_intArray = 1; 74 private int[] mExportVar_intArray; 75 public synchronized void set_intArray(int[] v) { 76 mExportVar_intArray = v; 77 FieldPacker fp = new FieldPacker(40); 78 for (int ct1 = 0; ct1 < 10; ct1++) { 79 fp.addI32(v[ct1]); 80 } 81 82 int []__dimArr = new int[1]; 83 __dimArr[0] = 10; 84 setVar(mExportVarIdx_intArray, fp, __I32, __dimArr); 85 } 86 87 public int[] get_intArray() { 88 return mExportVar_intArray; 89 } 90 91 public Script.FieldID getFieldID_intArray() { 92 return createFieldID(mExportVarIdx_intArray, null); 93 } 94 95 private final static int mExportVarIdx_matVar = 2; 96 private Matrix2f mExportVar_matVar; 97 public synchronized void set_matVar(Matrix2f v) { 98 mExportVar_matVar = v; 99 FieldPacker fp = new FieldPacker(16); 100 fp.addMatrix(v); 101 setVar(mExportVarIdx_matVar, fp); 102 } 103 104 public Matrix2f get_matVar() { 105 return mExportVar_matVar; 106 } 107 108 public Script.FieldID getFieldID_matVar() { 109 return createFieldID(mExportVarIdx_matVar, null); 110 } 111 112 private final static int mExportVarIdx_matArray = 3; 113 private Matrix2f[] mExportVar_matArray; 114 public synchronized void set_matArray(Matrix2f[] v) { 115 mExportVar_matArray = v; 116 FieldPacker fp = new FieldPacker(160); 117 for (int ct1 = 0; ct1 < 10; ct1++) { 118 fp.addMatrix(v[ct1]); 119 } 120 121 int []__dimArr = new int[1]; 122 __dimArr[0] = 10; 123 setVar(mExportVarIdx_matArray, fp, __@@INVALID@@, __dimArr); 124 } 125 126 public Matrix2f[] get_matArray() { 127 return mExportVar_matArray; 128 } 129 130 public Script.FieldID getFieldID_matArray() { 131 return createFieldID(mExportVarIdx_matArray, null); 132 } 133 134 private final static int mExportVarIdx_allocVar = 4; 135 private Allocation mExportVar_allocVar; 136 public synchronized void set_allocVar(Allocation v) { 137 setVar(mExportVarIdx_allocVar, v); 138 mExportVar_allocVar = v; 139 } 140 141 public Allocation get_allocVar() { 142 return mExportVar_allocVar; 143 } 144 145 public Script.FieldID getFieldID_allocVar() { 146 return createFieldID(mExportVarIdx_allocVar, null); 147 } 148 149 private final static int mExportVarIdx_allocArray = 5; 150 private Allocation[] mExportVar_allocArray; 151 public synchronized void set_allocArray(Allocation[] v) { 152 mExportVar_allocArray = v; 153 FieldPacker fp = new FieldPacker(sIs64Bit ? 320 : 40); 154 for (int ct1 = 0; ct1 < 10; ct1++) { 155 fp.addObj(v[ct1]); 156 } 157 158 int []__dimArr = new int[1]; 159 __dimArr[0] = 10; 160 setVar(mExportVarIdx_allocArray, fp, __ALLOCATION, __dimArr); 161 } 162 163 public Allocation[] get_allocArray() { 164 return mExportVar_allocArray; 165 } 166 167 public Script.FieldID getFieldID_allocArray() { 168 return createFieldID(mExportVarIdx_allocArray, null); 169 } 170 171 private final static int mExportVarIdx_ndVar = 6; 172 private ScriptField_NonDivergent.Item mExportVar_ndVar; 173 public synchronized void set_ndVar(ScriptField_NonDivergent.Item v) { 174 mExportVar_ndVar = v; 175 FieldPacker fp = new FieldPacker(8); 176 fp.addI32(v.i); 177 fp.addI32(v.j); 178 int []__dimArr = new int[1]; 179 __dimArr[0] = 1; 180 setVar(mExportVarIdx_ndVar, fp, __ScriptField_NonDivergent, __dimArr); 181 } 182 183 public ScriptField_NonDivergent.Item get_ndVar() { 184 return mExportVar_ndVar; 185 } 186 187 public Script.FieldID getFieldID_ndVar() { 188 return createFieldID(mExportVarIdx_ndVar, null); 189 } 190 191 private final static int mExportVarIdx_ndArray = 7; 192 private ScriptField_NonDivergent.Item[] mExportVar_ndArray; 193 public synchronized void set_ndArray(ScriptField_NonDivergent.Item[] v) { 194 mExportVar_ndArray = v; 195 FieldPacker fp = new FieldPacker(80); 196 for (int ct1 = 0; ct1 < 10; ct1++) { 197 fp.addI32(v[ct1].i); 198 fp.addI32(v[ct1].j); 199 } 200 201 int []__dimArr = new int[1]; 202 __dimArr[0] = 10; 203 setVar(mExportVarIdx_ndArray, fp, __ScriptField_NonDivergent, __dimArr); 204 } 205 206 public ScriptField_NonDivergent.Item[] get_ndArray() { 207 return mExportVar_ndArray; 208 } 209 210 public Script.FieldID getFieldID_ndArray() { 211 return createFieldID(mExportVarIdx_ndArray, null); 212 } 213 214 private final static int mExportVarIdx_dVar = 8; 215 private ScriptField_Divergent.Item mExportVar_dVar; 216 public synchronized void set_dVar(ScriptField_Divergent.Item v) { 217 mExportVar_dVar = v; 218 FieldPacker fp = new FieldPacker(sIs64Bit ? 48 : 12); 219 fp.addI32(v.i); 220 fp.skip(sIs64Bit ? 4 : 0); 221 fp.addObj(v.a); 222 fp.addI32(v.j); 223 fp.skip(sIs64Bit ? 4 : 0); 224 int []__dimArr = new int[1]; 225 __dimArr[0] = 1; 226 setVar(mExportVarIdx_dVar, fp, __ScriptField_Divergent, __dimArr); 227 } 228 229 public ScriptField_Divergent.Item get_dVar() { 230 return mExportVar_dVar; 231 } 232 233 public Script.FieldID getFieldID_dVar() { 234 return createFieldID(mExportVarIdx_dVar, null); 235 } 236 237 private final static int mExportVarIdx_dArray = 9; 238 private ScriptField_Divergent.Item[] mExportVar_dArray; 239 public synchronized void set_dArray(ScriptField_Divergent.Item[] v) { 240 mExportVar_dArray = v; 241 FieldPacker fp = new FieldPacker(sIs64Bit ? 400 : 120); 242 for (int ct1 = 0; ct1 < 10; ct1++) { 243 fp.addI32(v[ct1].i); 244 fp.skip(sIs64Bit ? 4 : 0); 245 fp.addObj(v[ct1].a); 246 fp.addI32(v[ct1].j); 247 fp.skip(sIs64Bit ? 4 : 0); 248 } 249 250 int []__dimArr = new int[1]; 251 __dimArr[0] = 10; 252 setVar(mExportVarIdx_dArray, fp, __ScriptField_Divergent, __dimArr); 253 } 254 255 public ScriptField_Divergent.Item[] get_dArray() { 256 return mExportVar_dArray; 257 } 258 259 public Script.FieldID getFieldID_dArray() { 260 return createFieldID(mExportVarIdx_dArray, null); 261 } 262 263 //private final static int mExportForEachIdx_root = 0; 264 private final static int mExportForEachIdx_dnFe = 1; 265 public Script.KernelID getKernelID_dnFe() { 266 return createKernelID(mExportForEachIdx_dnFe, 7, null, null); 267 } 268 269 public void forEach_dnFe(Allocation ain, Allocation aout, ScriptField_DivergentNest.Item data) { 270 forEach_dnFe(ain, aout, data, null); 271 } 272 273 public void forEach_dnFe(Allocation ain, Allocation aout, ScriptField_DivergentNest.Item data, Script.LaunchOptions sc) { 274 // check ain 275 if (!ain.getType().getElement().isCompatible(__I32)) { 276 throw new RSRuntimeException("Type mismatch with I32!"); 277 } 278 // check aout 279 if (!aout.getType().getElement().isCompatible(__I32)) { 280 throw new RSRuntimeException("Type mismatch with I32!"); 281 } 282 Type t0, t1; // Verify dimensions 283 t0 = ain.getType(); 284 t1 = aout.getType(); 285 if ((t0.getCount() != t1.getCount()) || 286 (t0.getX() != t1.getX()) || 287 (t0.getY() != t1.getY()) || 288 (t0.getZ() != t1.getZ()) || 289 (t0.hasFaces() != t1.hasFaces()) || 290 (t0.hasMipmaps() != t1.hasMipmaps())) { 291 throw new RSRuntimeException("Dimension mismatch between parameters ain and aout!"); 292 } 293 294 FieldPacker dnFe_fp = new FieldPacker(sIs64Bit ? 64 : 20); 295 dnFe_fp.addI32(data.x); 296 dnFe_fp.skip(sIs64Bit ? 4 : 0); 297 dnFe_fp.addI32(data.d.i); 298 dnFe_fp.skip(sIs64Bit ? 4 : 0); 299 dnFe_fp.addObj(data.d.a); 300 dnFe_fp.addI32(data.d.j); 301 dnFe_fp.skip(sIs64Bit ? 4 : 0); 302 dnFe_fp.addI32(data.y); 303 dnFe_fp.skip(sIs64Bit ? 4 : 0); 304 forEach(mExportForEachIdx_dnFe, ain, aout, dnFe_fp, sc); 305 } 306 307 private final static int mExportForEachIdx_dFe = 2; 308 public Script.KernelID getKernelID_dFe() { 309 return createKernelID(mExportForEachIdx_dFe, 7, null, null); 310 } 311 312 public void forEach_dFe(Allocation ain, Allocation aout, ScriptField_Divergent.Item data) { 313 forEach_dFe(ain, aout, data, null); 314 } 315 316 public void forEach_dFe(Allocation ain, Allocation aout, ScriptField_Divergent.Item data, Script.LaunchOptions sc) { 317 // check ain 318 if (!ain.getType().getElement().isCompatible(__I32)) { 319 throw new RSRuntimeException("Type mismatch with I32!"); 320 } 321 // check aout 322 if (!aout.getType().getElement().isCompatible(__I32)) { 323 throw new RSRuntimeException("Type mismatch with I32!"); 324 } 325 Type t0, t1; // Verify dimensions 326 t0 = ain.getType(); 327 t1 = aout.getType(); 328 if ((t0.getCount() != t1.getCount()) || 329 (t0.getX() != t1.getX()) || 330 (t0.getY() != t1.getY()) || 331 (t0.getZ() != t1.getZ()) || 332 (t0.hasFaces() != t1.hasFaces()) || 333 (t0.hasMipmaps() != t1.hasMipmaps())) { 334 throw new RSRuntimeException("Dimension mismatch between parameters ain and aout!"); 335 } 336 337 FieldPacker dFe_fp = new FieldPacker(sIs64Bit ? 48 : 12); 338 dFe_fp.addI32(data.i); 339 dFe_fp.skip(sIs64Bit ? 4 : 0); 340 dFe_fp.addObj(data.a); 341 dFe_fp.addI32(data.j); 342 dFe_fp.skip(sIs64Bit ? 4 : 0); 343 forEach(mExportForEachIdx_dFe, ain, aout, dFe_fp, sc); 344 } 345 346 private final static int mExportForEachIdx_ndFe = 3; 347 public Script.KernelID getKernelID_ndFe() { 348 return createKernelID(mExportForEachIdx_ndFe, 7, null, null); 349 } 350 351 public void forEach_ndFe(Allocation ain, Allocation aout, ScriptField_NonDivergent.Item data) { 352 forEach_ndFe(ain, aout, data, null); 353 } 354 355 public void forEach_ndFe(Allocation ain, Allocation aout, ScriptField_NonDivergent.Item data, Script.LaunchOptions sc) { 356 // check ain 357 if (!ain.getType().getElement().isCompatible(__I32)) { 358 throw new RSRuntimeException("Type mismatch with I32!"); 359 } 360 // check aout 361 if (!aout.getType().getElement().isCompatible(__I32)) { 362 throw new RSRuntimeException("Type mismatch with I32!"); 363 } 364 Type t0, t1; // Verify dimensions 365 t0 = ain.getType(); 366 t1 = aout.getType(); 367 if ((t0.getCount() != t1.getCount()) || 368 (t0.getX() != t1.getX()) || 369 (t0.getY() != t1.getY()) || 370 (t0.getZ() != t1.getZ()) || 371 (t0.hasFaces() != t1.hasFaces()) || 372 (t0.hasMipmaps() != t1.hasMipmaps())) { 373 throw new RSRuntimeException("Dimension mismatch between parameters ain and aout!"); 374 } 375 376 FieldPacker ndFe_fp = new FieldPacker(8); 377 ndFe_fp.addI32(data.i); 378 ndFe_fp.addI32(data.j); 379 forEach(mExportForEachIdx_ndFe, ain, aout, ndFe_fp, sc); 380 } 381 382 private final static int mExportForEachIdx_allocFe = 4; 383 public Script.KernelID getKernelID_allocFe() { 384 return createKernelID(mExportForEachIdx_allocFe, 7, null, null); 385 } 386 387 public void forEach_allocFe(Allocation ain, Allocation aout, Allocation data) { 388 forEach_allocFe(ain, aout, data, null); 389 } 390 391 public void forEach_allocFe(Allocation ain, Allocation aout, Allocation data, Script.LaunchOptions sc) { 392 // check ain 393 if (!ain.getType().getElement().isCompatible(__I32)) { 394 throw new RSRuntimeException("Type mismatch with I32!"); 395 } 396 // check aout 397 if (!aout.getType().getElement().isCompatible(__I32)) { 398 throw new RSRuntimeException("Type mismatch with I32!"); 399 } 400 Type t0, t1; // Verify dimensions 401 t0 = ain.getType(); 402 t1 = aout.getType(); 403 if ((t0.getCount() != t1.getCount()) || 404 (t0.getX() != t1.getX()) || 405 (t0.getY() != t1.getY()) || 406 (t0.getZ() != t1.getZ()) || 407 (t0.hasFaces() != t1.hasFaces()) || 408 (t0.hasMipmaps() != t1.hasMipmaps())) { 409 throw new RSRuntimeException("Dimension mismatch between parameters ain and aout!"); 410 } 411 412 FieldPacker allocFe_fp = new FieldPacker(sIs64Bit ? 32 : 4); 413 allocFe_fp.addObj(data); 414 forEach(mExportForEachIdx_allocFe, ain, aout, allocFe_fp, sc); 415 } 416 417 private final static int mExportForEachIdx_matFe = 5; 418 public Script.KernelID getKernelID_matFe() { 419 return createKernelID(mExportForEachIdx_matFe, 7, null, null); 420 } 421 422 public void forEach_matFe(Allocation ain, Allocation aout, Matrix2f data) { 423 forEach_matFe(ain, aout, data, null); 424 } 425 426 public void forEach_matFe(Allocation ain, Allocation aout, Matrix2f data, Script.LaunchOptions sc) { 427 // check ain 428 if (!ain.getType().getElement().isCompatible(__I32)) { 429 throw new RSRuntimeException("Type mismatch with I32!"); 430 } 431 // check aout 432 if (!aout.getType().getElement().isCompatible(__I32)) { 433 throw new RSRuntimeException("Type mismatch with I32!"); 434 } 435 Type t0, t1; // Verify dimensions 436 t0 = ain.getType(); 437 t1 = aout.getType(); 438 if ((t0.getCount() != t1.getCount()) || 439 (t0.getX() != t1.getX()) || 440 (t0.getY() != t1.getY()) || 441 (t0.getZ() != t1.getZ()) || 442 (t0.hasFaces() != t1.hasFaces()) || 443 (t0.hasMipmaps() != t1.hasMipmaps())) { 444 throw new RSRuntimeException("Dimension mismatch between parameters ain and aout!"); 445 } 446 447 FieldPacker matFe_fp = new FieldPacker(16); 448 matFe_fp.addMatrix(data); 449 forEach(mExportForEachIdx_matFe, ain, aout, matFe_fp, sc); 450 } 451 452 private final static int mExportForEachIdx_intFe = 6; 453 public Script.KernelID getKernelID_intFe() { 454 return createKernelID(mExportForEachIdx_intFe, 7, null, null); 455 } 456 457 public void forEach_intFe(Allocation ain, Allocation aout, int data) { 458 forEach_intFe(ain, aout, data, null); 459 } 460 461 public void forEach_intFe(Allocation ain, Allocation aout, int data, Script.LaunchOptions sc) { 462 // check ain 463 if (!ain.getType().getElement().isCompatible(__I32)) { 464 throw new RSRuntimeException("Type mismatch with I32!"); 465 } 466 // check aout 467 if (!aout.getType().getElement().isCompatible(__I32)) { 468 throw new RSRuntimeException("Type mismatch with I32!"); 469 } 470 Type t0, t1; // Verify dimensions 471 t0 = ain.getType(); 472 t1 = aout.getType(); 473 if ((t0.getCount() != t1.getCount()) || 474 (t0.getX() != t1.getX()) || 475 (t0.getY() != t1.getY()) || 476 (t0.getZ() != t1.getZ()) || 477 (t0.hasFaces() != t1.hasFaces()) || 478 (t0.hasMipmaps() != t1.hasMipmaps())) { 479 throw new RSRuntimeException("Dimension mismatch between parameters ain and aout!"); 480 } 481 482 FieldPacker intFe_fp = new FieldPacker(4); 483 intFe_fp.addI32(data); 484 forEach(mExportForEachIdx_intFe, ain, aout, intFe_fp, sc); 485 } 486 487 private final static int mExportFuncIdx_ndInv = 0; 488 public Script.InvokeID getInvokeID_ndInv() { 489 return createInvokeID(mExportFuncIdx_ndInv); 490 } 491 492 public void invoke_ndInv(int i, int j) { 493 FieldPacker ndInv_fp = new FieldPacker(8); 494 ndInv_fp.addI32(i); 495 ndInv_fp.addI32(j); 496 invoke(mExportFuncIdx_ndInv, ndInv_fp); 497 } 498 499 private final static int mExportFuncIdx_dInv = 1; 500 public Script.InvokeID getInvokeID_dInv() { 501 return createInvokeID(mExportFuncIdx_dInv); 502 } 503 504 public void invoke_dInv(int i, Allocation a, int j) { 505 FieldPacker dInv_fp = new FieldPacker(sIs64Bit ? 48 : 12); 506 dInv_fp.addI32(i); 507 dInv_fp.skip(sIs64Bit ? 4 : 0); 508 dInv_fp.addObj(a); 509 dInv_fp.addI32(j); 510 dInv_fp.skip(sIs64Bit ? 4 : 0); 511 invoke(mExportFuncIdx_dInv, dInv_fp); 512 } 513 514 private final static int mExportFuncIdx_dnInv = 2; 515 public Script.InvokeID getInvokeID_dnInv() { 516 return createInvokeID(mExportFuncIdx_dnInv); 517 } 518 519 public void invoke_dnInv(int x, ScriptField_Divergent.Item d, int y) { 520 FieldPacker dnInv_fp = new FieldPacker(sIs64Bit ? 64 : 20); 521 dnInv_fp.addI32(x); 522 dnInv_fp.skip(sIs64Bit ? 4 : 0); 523 dnInv_fp.addI32(d.i); 524 dnInv_fp.skip(sIs64Bit ? 4 : 0); 525 dnInv_fp.addObj(d.a); 526 dnInv_fp.addI32(d.j); 527 dnInv_fp.skip(sIs64Bit ? 4 : 0); 528 dnInv_fp.addI32(y); 529 dnInv_fp.skip(sIs64Bit ? 4 : 0); 530 invoke(mExportFuncIdx_dnInv, dnInv_fp); 531 } 532 533 private static boolean sIs64Bit; 534 535 static { 536 if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { 537 sIs64Bit = Process.is64Bit(); 538 } 539 540 else { 541 try { 542 Field f = RenderScript.class.getDeclaredField("sPointerSize"); 543 f.setAccessible(true); 544 sIs64Bit = (f.getInt(null) == 8); 545 } 546 547 catch (Throwable e) { 548 sIs64Bit = false; 549 } 550 551 } 552 553 } 554 555} 556 557