1 /* 2 * Copyright (C) 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 package android.renderscript.cts; 19 20 import android.renderscript.*; 21 22 public class GetSetTest extends RSBaseCompute { 23 24 private ScriptC_getset script; 25 private ScriptC_getset_relaxed scriptRelaxed; 26 Allocation walkAlloc; 27 Allocation in1DAlloc; 28 Allocation out1DAlloc; 29 Allocation in2DAlloc; 30 Allocation out2DAlloc; 31 Allocation in3DAlloc; 32 Allocation out3DAlloc; 33 private static java.util.Random random = new java.util.Random(); 34 35 final int gWidth = 252; 36 final int gHeight = 31; 37 final int gDepth = 4; 38 final int gCount = gWidth * gHeight * gDepth; 39 40 @Override setUp()41 protected void setUp() throws Exception { 42 super.setUp(); 43 random.setSeed(10); 44 script = new ScriptC_getset(mRS); 45 scriptRelaxed = new ScriptC_getset_relaxed(mRS); 46 script.set_gWidth(gWidth); 47 script.set_gHeight(gHeight); 48 scriptRelaxed.set_gWidth(gWidth); 49 scriptRelaxed.set_gHeight(gHeight); 50 } 51 52 @Override tearDown()53 protected void tearDown() throws Exception { 54 if (walkAlloc != null) { 55 walkAlloc.destroy(); 56 } 57 if (in1DAlloc != null) { 58 in1DAlloc.destroy(); 59 } 60 if (out1DAlloc != null) { 61 out1DAlloc.destroy(); 62 } 63 if (in2DAlloc != null) { 64 in2DAlloc.destroy(); 65 } 66 if (out2DAlloc != null) { 67 out2DAlloc.destroy(); 68 } 69 if (in3DAlloc != null) { 70 in3DAlloc.destroy(); 71 } 72 if (out3DAlloc != null) { 73 out3DAlloc.destroy(); 74 } 75 script.destroy(); 76 scriptRelaxed.destroy(); 77 super.tearDown(); 78 } 79 createWalk(int vsize)80 protected void createWalk(int vsize) { 81 // We do a random copy order to attempt to get multiple threads 82 // reading and writing the same cache line 83 // We could do this as a simple walk but that would likely miss 84 // some caching issues. 85 final int tw = gCount / vsize; 86 int tmp[] = new int[tw]; 87 boolean b[] = new boolean[tw]; 88 int toCopy = tw; 89 int i = 0; 90 91 while (toCopy > 0) { 92 int x = random.nextInt(tw); 93 94 while ((x < tw) && b[x]) { 95 x++; 96 if (x >= tw) { 97 x = 0; 98 } 99 } 100 101 b[x] = true; 102 toCopy --; 103 104 //android.util.Log.v("rs", "walk " + i + ", " + x); 105 tmp[i++] = x; 106 } 107 108 walkAlloc = Allocation.createSized(mRS, Element.I32(mRS), tw); 109 walkAlloc.copy1DRangeFrom(0, tw, tmp); 110 } 111 testSetup(Element e)112 private void testSetup(Element e) { 113 int vs = e.getVectorSize(); 114 if (vs == 3) { 115 vs = 4; 116 } 117 createWalk(vs); 118 119 Type t1 = Type.createX(mRS, e, gWidth * gHeight * gDepth / vs); 120 in1DAlloc = Allocation.createTyped(mRS, t1); 121 out1DAlloc = Allocation.createTyped(mRS, t1); 122 script.set_gAlloc1DIn(in1DAlloc); 123 script.set_gAlloc1DOut(out1DAlloc); 124 scriptRelaxed.set_gAlloc1DIn(in1DAlloc); 125 scriptRelaxed.set_gAlloc1DOut(out1DAlloc); 126 127 Type t2 = Type.createXY(mRS, e, gWidth / vs, gHeight * gDepth); 128 in2DAlloc = Allocation.createTyped(mRS, t2); 129 out2DAlloc = Allocation.createTyped(mRS, t2); 130 script.set_gAlloc2DIn(in2DAlloc); 131 script.set_gAlloc2DOut(out2DAlloc); 132 scriptRelaxed.set_gAlloc2DIn(in2DAlloc); 133 scriptRelaxed.set_gAlloc2DOut(out2DAlloc); 134 135 Type t3 = Type.createXYZ(mRS, e, gWidth / vs, gHeight, gDepth); 136 in3DAlloc = Allocation.createTyped(mRS, t3); 137 out3DAlloc = Allocation.createTyped(mRS, t3); 138 script.set_gAlloc3DIn(in3DAlloc); 139 script.set_gAlloc3DOut(out3DAlloc); 140 scriptRelaxed.set_gAlloc3DIn(in3DAlloc); 141 scriptRelaxed.set_gAlloc3DOut(out3DAlloc); 142 } 143 verify(byte[] a1, byte[] a2, Allocation alloc, String s, int vsize)144 private void verify(byte[] a1, byte[] a2, Allocation alloc, String s, int vsize) { 145 alloc.copyTo(a2); 146 for (int i=0; i < gCount; i++) { 147 if (a1[i] != a2[i]) { 148 if ((vsize == 3) && ((i % 4) == 3)) { 149 continue; 150 } 151 throw new RSRuntimeException(s + a1[i] + ", " + a2[i] + ", at " + i); 152 } 153 a2[i] = 0; 154 } 155 alloc.copyFrom(a2); 156 } 157 verify(short[] a1, short[] a2, Allocation alloc, String s, int vsize)158 private void verify(short[] a1, short[] a2, Allocation alloc, String s, int vsize) { 159 alloc.copyTo(a2); 160 for (int i=0; i < gCount; i++) { 161 if (a1[i] != a2[i]) { 162 if ((vsize == 3) && ((i % 4) == 3)) { 163 continue; 164 } 165 throw new RSRuntimeException(s + a1[i] + ", " + a2[i] + ", at " + i); 166 } 167 a2[i] = 0; 168 } 169 alloc.copyFrom(a2); 170 } 171 verify(int[] a1, int[] a2, Allocation alloc, String s, int vsize)172 private void verify(int[] a1, int[] a2, Allocation alloc, String s, int vsize) { 173 alloc.copyTo(a2); 174 for (int i=0; i < gCount; i++) { 175 if (a1[i] != a2[i]) { 176 if ((vsize == 3) && ((i % 4) == 3)) { 177 continue; 178 } 179 throw new RSRuntimeException(s + a1[i] + ", " + a2[i] + ", at " + i); 180 } 181 a2[i] = 0; 182 } 183 alloc.copyFrom(a2); 184 } 185 verify(long[] a1, long[] a2, Allocation alloc, String s, int vsize)186 private void verify(long[] a1, long[] a2, Allocation alloc, String s, int vsize) { 187 alloc.copyTo(a2); 188 for (int i=0; i < gCount; i++) { 189 if (a1[i] != a2[i]) { 190 if ((vsize == 3) && ((i % 4) == 3)) { 191 continue; 192 } 193 throw new RSRuntimeException(s + a1[i] + ", " + a2[i] + ", at " + i); 194 } 195 a2[i] = 0; 196 } 197 alloc.copyFrom(a2); 198 } 199 verify(float[] a1, float[] a2, Allocation alloc, String s, int vsize)200 private void verify(float[] a1, float[] a2, Allocation alloc, String s, int vsize) { 201 alloc.copyTo(a2); 202 for (int i=0; i < gCount; i++) { 203 if (a1[i] != a2[i]) { 204 if ((vsize == 3) && ((i % 4) == 3)) { 205 continue; 206 } 207 throw new RSRuntimeException(s + a1[i] + ", " + a2[i] + ", at " + i); 208 } 209 a2[i] = 0; 210 } 211 alloc.copyFrom(a2); 212 } 213 verify(double[] a1, double[] a2, Allocation alloc, String s, int vsize)214 private void verify(double[] a1, double[] a2, Allocation alloc, String s, int vsize) { 215 alloc.copyTo(a2); 216 for (int i=0; i < gCount; i++) { 217 if (a1[i] != a2[i]) { 218 if ((vsize == 3) && ((i % 4) == 3)) { 219 continue; 220 } 221 throw new RSRuntimeException(s + a1[i] + ", " + a2[i] + ", at " + i); 222 } 223 a2[i] = 0; 224 } 225 alloc.copyFrom(a2); 226 } 227 randomByteArray(int len)228 private byte[] randomByteArray(int len) { 229 byte t[] = new byte[len]; 230 random.nextBytes(t); 231 in1DAlloc.copyFrom(t); 232 in2DAlloc.copyFrom(t); 233 in3DAlloc.copyFrom(t); 234 return t; 235 } 236 randomShortArray(int len)237 private short[] randomShortArray(int len) { 238 short t[] = new short[len]; 239 for (int i = 0; i < t.length; i++) { 240 t[i] = (short)(random.nextInt() & 0xffff); 241 } 242 in1DAlloc.copyFrom(t); 243 in2DAlloc.copyFrom(t); 244 in3DAlloc.copyFrom(t); 245 return t; 246 } 247 randomIntArray(int len)248 private int[] randomIntArray(int len) { 249 int t[] = new int[len]; 250 for (int i = 0; i < t.length; i++) { 251 t[i] = random.nextInt(); 252 } 253 in1DAlloc.copyFrom(t); 254 in2DAlloc.copyFrom(t); 255 in3DAlloc.copyFrom(t); 256 return t; 257 } 258 randomLongArray(int len)259 private long[] randomLongArray(int len) { 260 long t[] = new long[len]; 261 for (int i = 0; i < t.length; i++) { 262 t[i] = random.nextLong(); 263 } 264 in1DAlloc.copyFrom(t); 265 in2DAlloc.copyFrom(t); 266 in3DAlloc.copyFrom(t); 267 return t; 268 } 269 randomFloatArray(int len)270 private float[] randomFloatArray(int len) { 271 float t[] = new float[len]; 272 for (int i = 0; i < t.length; i++) { 273 t[i] = random.nextFloat(); 274 } 275 in1DAlloc.copyFrom(t); 276 in2DAlloc.copyFrom(t); 277 in3DAlloc.copyFrom(t); 278 return t; 279 } 280 randomDoubleArray(int len)281 private double[] randomDoubleArray(int len) { 282 double t[] = new double[len]; 283 for (int i = 0; i < t.length; i++) { 284 t[i] = random.nextDouble(); 285 } 286 in1DAlloc.copyFrom(t); 287 in2DAlloc.copyFrom(t); 288 in3DAlloc.copyFrom(t); 289 return t; 290 } 291 testGetSet_char()292 public void testGetSet_char() { 293 testSetup(Element.I8(mRS)); 294 byte tmp[] = randomByteArray(gCount); 295 byte tmp2[] = new byte[gCount]; 296 297 script.forEach_copy1D_char(walkAlloc); 298 verify(tmp, tmp2, out1DAlloc, "Data mismatch char: ", 1); 299 scriptRelaxed.forEach_copy1D_char(walkAlloc); 300 verify(tmp, tmp2, out1DAlloc, "Data mismatch relaxed char: ", 1); 301 302 script.forEach_copy2D_char(walkAlloc); 303 verify(tmp, tmp2, out2DAlloc, "Data mismatch char: ", 1); 304 scriptRelaxed.forEach_copy2D_char(walkAlloc); 305 verify(tmp, tmp2, out2DAlloc, "Data mismatch relaxed char: ", 1); 306 307 script.forEach_copy3D_char(walkAlloc); 308 verify(tmp, tmp2, out3DAlloc, "Data mismatch char: ", 1); 309 scriptRelaxed.forEach_copy3D_char(walkAlloc); 310 verify(tmp, tmp2, out3DAlloc, "Data mismatch relaxed char: ", 1); 311 } 312 testGetSet_char2()313 public void testGetSet_char2() { 314 testSetup(Element.I8_2(mRS)); 315 byte tmp[] = randomByteArray(gCount); 316 byte tmp2[] = new byte[gCount]; 317 script.forEach_copy1D_char2(walkAlloc); 318 verify(tmp, tmp2, out1DAlloc, "Data mismatch char2: ", 2); 319 scriptRelaxed.forEach_copy1D_char2(walkAlloc); 320 verify(tmp, tmp2, out1DAlloc, "Data mismatch relaxed char2: ", 2); 321 322 script.forEach_copy2D_char2(walkAlloc); 323 verify(tmp, tmp2, out2DAlloc, "Data mismatch char2: ", 2); 324 scriptRelaxed.forEach_copy2D_char2(walkAlloc); 325 verify(tmp, tmp2, out2DAlloc, "Data mismatch relaxed char2: ", 2); 326 327 script.forEach_copy3D_char2(walkAlloc); 328 verify(tmp, tmp2, out3DAlloc, "Data mismatch char2: ", 2); 329 scriptRelaxed.forEach_copy3D_char2(walkAlloc); 330 verify(tmp, tmp2, out3DAlloc, "Data mismatch relaxed char2: ", 2); 331 } 332 testGetSet_char3()333 public void testGetSet_char3() { 334 testSetup(Element.I8_3(mRS)); 335 byte tmp[] = randomByteArray(gCount); 336 byte tmp2[] = new byte[gCount]; 337 script.forEach_copy1D_char3(walkAlloc); 338 verify(tmp, tmp2, out1DAlloc, "Data mismatch char3: ", 3); 339 scriptRelaxed.forEach_copy1D_char3(walkAlloc); 340 verify(tmp, tmp2, out1DAlloc, "Data mismatch relaxed char3: ", 3); 341 342 script.forEach_copy2D_char3(walkAlloc); 343 verify(tmp, tmp2, out2DAlloc, "Data mismatch char3: ", 3); 344 scriptRelaxed.forEach_copy2D_char3(walkAlloc); 345 verify(tmp, tmp2, out2DAlloc, "Data mismatch relaxed char3: ", 3); 346 347 script.forEach_copy3D_char3(walkAlloc); 348 verify(tmp, tmp2, out3DAlloc, "Data mismatch char3: ", 3); 349 scriptRelaxed.forEach_copy3D_char3(walkAlloc); 350 verify(tmp, tmp2, out3DAlloc, "Data mismatch relaxed char3: ", 3); 351 } 352 testGetSet_char4()353 public void testGetSet_char4() { 354 testSetup(Element.I8_4(mRS)); 355 byte tmp[] = randomByteArray(gCount); 356 byte tmp2[] = new byte[gCount]; 357 script.forEach_copy1D_char4(walkAlloc); 358 verify(tmp, tmp2, out1DAlloc, "Data mismatch char4: ", 4); 359 scriptRelaxed.forEach_copy1D_char4(walkAlloc); 360 verify(tmp, tmp2, out1DAlloc, "Data mismatch relaxed char4: ", 4); 361 362 script.forEach_copy2D_char4(walkAlloc); 363 verify(tmp, tmp2, out2DAlloc, "Data mismatch char4: ", 4); 364 scriptRelaxed.forEach_copy2D_char4(walkAlloc); 365 verify(tmp, tmp2, out2DAlloc, "Data mismatch relaxed char4: ", 4); 366 367 script.forEach_copy3D_char4(walkAlloc); 368 verify(tmp, tmp2, out3DAlloc, "Data mismatch char4: ", 4); 369 scriptRelaxed.forEach_copy3D_char4(walkAlloc); 370 verify(tmp, tmp2, out3DAlloc, "Data mismatch relaxed char4: ", 4); 371 } 372 testGetSet_uchar()373 public void testGetSet_uchar() { 374 testSetup(Element.U8(mRS)); 375 byte tmp[] = randomByteArray(gCount); 376 byte tmp2[] = new byte[gCount]; 377 script.forEach_copy1D_uchar(walkAlloc); 378 verify(tmp, tmp2, out1DAlloc, "Data mismatch uchar: ", 1); 379 scriptRelaxed.forEach_copy1D_uchar(walkAlloc); 380 verify(tmp, tmp2, out1DAlloc, "Data mismatch relaxed uchar: ", 1); 381 382 script.forEach_copy2D_uchar(walkAlloc); 383 verify(tmp, tmp2, out2DAlloc, "Data mismatch uchar: ", 1); 384 scriptRelaxed.forEach_copy2D_uchar(walkAlloc); 385 verify(tmp, tmp2, out2DAlloc, "Data mismatch relaxed uchar: ", 1); 386 387 script.forEach_copy3D_uchar(walkAlloc); 388 verify(tmp, tmp2, out3DAlloc, "Data mismatch uchar: ", 1); 389 scriptRelaxed.forEach_copy3D_uchar(walkAlloc); 390 verify(tmp, tmp2, out3DAlloc, "Data mismatch relaxed uchar: ", 1); 391 } 392 testGetSet_uchar2()393 public void testGetSet_uchar2() { 394 testSetup(Element.U8_2(mRS)); 395 byte tmp[] = randomByteArray(gCount); 396 byte tmp2[] = new byte[gCount]; 397 script.forEach_copy1D_uchar2(walkAlloc); 398 verify(tmp, tmp2, out1DAlloc, "Data mismatch uchar2: ", 2); 399 scriptRelaxed.forEach_copy1D_uchar2(walkAlloc); 400 verify(tmp, tmp2, out1DAlloc, "Data mismatch relaxed uchar2: ", 2); 401 402 script.forEach_copy2D_uchar2(walkAlloc); 403 verify(tmp, tmp2, out2DAlloc, "Data mismatch uchar2: ", 2); 404 scriptRelaxed.forEach_copy2D_uchar2(walkAlloc); 405 verify(tmp, tmp2, out2DAlloc, "Data mismatch relaxed uchar2: ", 2); 406 407 script.forEach_copy3D_uchar2(walkAlloc); 408 verify(tmp, tmp2, out3DAlloc, "Data mismatch uchar2: ", 2); 409 scriptRelaxed.forEach_copy3D_uchar2(walkAlloc); 410 verify(tmp, tmp2, out3DAlloc, "Data mismatch relaxed uchar2: ", 2); 411 } 412 testGetSet_uchar3()413 public void testGetSet_uchar3() { 414 testSetup(Element.U8_3(mRS)); 415 byte tmp[] = randomByteArray(gCount); 416 byte tmp2[] = new byte[gCount]; 417 script.forEach_copy1D_uchar3(walkAlloc); 418 verify(tmp, tmp2, out1DAlloc, "Data mismatch uchar3: ", 3); 419 scriptRelaxed.forEach_copy1D_uchar3(walkAlloc); 420 verify(tmp, tmp2, out1DAlloc, "Data mismatch relaxed uchar3: ", 3); 421 422 script.forEach_copy2D_uchar3(walkAlloc); 423 verify(tmp, tmp2, out2DAlloc, "Data mismatch uchar3: ", 3); 424 scriptRelaxed.forEach_copy2D_uchar3(walkAlloc); 425 verify(tmp, tmp2, out2DAlloc, "Data mismatch relaxed uchar3: ", 3); 426 427 script.forEach_copy3D_uchar3(walkAlloc); 428 verify(tmp, tmp2, out3DAlloc, "Data mismatch uchar3: ", 3); 429 scriptRelaxed.forEach_copy3D_uchar3(walkAlloc); 430 verify(tmp, tmp2, out3DAlloc, "Data mismatch relaxed uchar3: ", 3); 431 } 432 testGetSet_uchar4()433 public void testGetSet_uchar4() { 434 testSetup(Element.U8_4(mRS)); 435 byte tmp[] = randomByteArray(gCount); 436 byte tmp2[] = new byte[gCount]; 437 script.forEach_copy1D_uchar4(walkAlloc); 438 verify(tmp, tmp2, out1DAlloc, "Data mismatch uchar4: ", 4); 439 scriptRelaxed.forEach_copy1D_uchar4(walkAlloc); 440 verify(tmp, tmp2, out1DAlloc, "Data mismatch relaxed uchar4: ", 4); 441 442 script.forEach_copy2D_uchar4(walkAlloc); 443 verify(tmp, tmp2, out2DAlloc, "Data mismatch uchar4: ", 4); 444 scriptRelaxed.forEach_copy2D_uchar4(walkAlloc); 445 verify(tmp, tmp2, out2DAlloc, "Data mismatch relaxed uchar4: ", 4); 446 447 script.forEach_copy3D_uchar4(walkAlloc); 448 verify(tmp, tmp2, out3DAlloc, "Data mismatch uchar4: ", 4); 449 scriptRelaxed.forEach_copy3D_uchar4(walkAlloc); 450 verify(tmp, tmp2, out3DAlloc, "Data mismatch relaxed uchar4: ", 4); 451 } 452 453 454 455 456 457 testGetSet_short()458 public void testGetSet_short() { 459 testSetup(Element.I16(mRS)); 460 short tmp[] = randomShortArray(gCount); 461 short tmp2[] = new short[gCount]; 462 script.forEach_copy1D_short(walkAlloc); 463 verify(tmp, tmp2, out1DAlloc, "Data mismatch short: ", 1); 464 scriptRelaxed.forEach_copy1D_short(walkAlloc); 465 verify(tmp, tmp2, out1DAlloc, "Data mismatch relaxed short: ", 1); 466 467 script.forEach_copy2D_short(walkAlloc); 468 verify(tmp, tmp2, out2DAlloc, "Data mismatch short: ", 1); 469 scriptRelaxed.forEach_copy2D_short(walkAlloc); 470 verify(tmp, tmp2, out2DAlloc, "Data mismatch relaxed short: ", 1); 471 472 script.forEach_copy3D_short(walkAlloc); 473 verify(tmp, tmp2, out3DAlloc, "Data mismatch short: ", 1); 474 scriptRelaxed.forEach_copy3D_short(walkAlloc); 475 verify(tmp, tmp2, out3DAlloc, "Data mismatch relaxed short: ", 1); 476 } 477 testGetSet_short2()478 public void testGetSet_short2() { 479 testSetup(Element.I16_2(mRS)); 480 short tmp[] = randomShortArray(gCount); 481 short tmp2[] = new short[gCount]; 482 script.forEach_copy1D_short2(walkAlloc); 483 verify(tmp, tmp2, out1DAlloc, "Data mismatch short2: ", 2); 484 scriptRelaxed.forEach_copy1D_short2(walkAlloc); 485 verify(tmp, tmp2, out1DAlloc, "Data mismatch relaxed short2: ", 2); 486 487 script.forEach_copy2D_short2(walkAlloc); 488 verify(tmp, tmp2, out2DAlloc, "Data mismatch short2: ", 2); 489 scriptRelaxed.forEach_copy2D_short2(walkAlloc); 490 verify(tmp, tmp2, out2DAlloc, "Data mismatch relaxed short2: ", 2); 491 492 script.forEach_copy3D_short2(walkAlloc); 493 verify(tmp, tmp2, out3DAlloc, "Data mismatch short2: ", 2); 494 scriptRelaxed.forEach_copy3D_short2(walkAlloc); 495 verify(tmp, tmp2, out3DAlloc, "Data mismatch relaxed short2: ", 2); 496 } 497 testGetSet_short3()498 public void testGetSet_short3() { 499 testSetup(Element.I16_3(mRS)); 500 short tmp[] = randomShortArray(gCount); 501 short tmp2[] = new short[gCount]; 502 script.forEach_copy1D_short3(walkAlloc); 503 verify(tmp, tmp2, out1DAlloc, "Data mismatch short3: ", 3); 504 scriptRelaxed.forEach_copy1D_short3(walkAlloc); 505 verify(tmp, tmp2, out1DAlloc, "Data mismatch relaxed short3: ", 3); 506 507 script.forEach_copy2D_short3(walkAlloc); 508 verify(tmp, tmp2, out2DAlloc, "Data mismatch short3: ", 3); 509 scriptRelaxed.forEach_copy2D_short3(walkAlloc); 510 verify(tmp, tmp2, out2DAlloc, "Data mismatch relaxed short3: ", 3); 511 512 script.forEach_copy3D_short3(walkAlloc); 513 verify(tmp, tmp2, out3DAlloc, "Data mismatch short3: ", 3); 514 scriptRelaxed.forEach_copy3D_short3(walkAlloc); 515 verify(tmp, tmp2, out3DAlloc, "Data mismatch relaxed short3: ", 3); 516 } 517 testGetSet_short4()518 public void testGetSet_short4() { 519 testSetup(Element.I16_4(mRS)); 520 short tmp[] = randomShortArray(gCount); 521 short tmp2[] = new short[gCount]; 522 script.forEach_copy1D_short4(walkAlloc); 523 verify(tmp, tmp2, out1DAlloc, "Data mismatch short4: ", 4); 524 scriptRelaxed.forEach_copy1D_short4(walkAlloc); 525 verify(tmp, tmp2, out1DAlloc, "Data mismatch relaxed short4: ", 4); 526 527 script.forEach_copy2D_short4(walkAlloc); 528 verify(tmp, tmp2, out2DAlloc, "Data mismatch short4: ", 4); 529 scriptRelaxed.forEach_copy2D_short4(walkAlloc); 530 verify(tmp, tmp2, out2DAlloc, "Data mismatch relaxed short4: ", 4); 531 532 script.forEach_copy3D_short4(walkAlloc); 533 verify(tmp, tmp2, out3DAlloc, "Data mismatch short4: ", 4); 534 scriptRelaxed.forEach_copy3D_short4(walkAlloc); 535 verify(tmp, tmp2, out3DAlloc, "Data mismatch relaxed short4: ", 4); 536 } 537 testGetSet_ushort()538 public void testGetSet_ushort() { 539 testSetup(Element.U16(mRS)); 540 short tmp[] = randomShortArray(gCount); 541 short tmp2[] = new short[gCount]; 542 script.forEach_copy1D_ushort(walkAlloc); 543 verify(tmp, tmp2, out1DAlloc, "Data mismatch ushort: ", 1); 544 scriptRelaxed.forEach_copy1D_ushort(walkAlloc); 545 verify(tmp, tmp2, out1DAlloc, "Data mismatch relaxed ushort: ", 1); 546 547 script.forEach_copy2D_ushort(walkAlloc); 548 verify(tmp, tmp2, out2DAlloc, "Data mismatch ushort: ", 1); 549 scriptRelaxed.forEach_copy2D_ushort(walkAlloc); 550 verify(tmp, tmp2, out2DAlloc, "Data mismatch relaxed ushort: ", 1); 551 552 script.forEach_copy3D_ushort(walkAlloc); 553 verify(tmp, tmp2, out3DAlloc, "Data mismatch ushort: ", 1); 554 scriptRelaxed.forEach_copy3D_ushort(walkAlloc); 555 verify(tmp, tmp2, out3DAlloc, "Data mismatch relaxed ushort: ", 1); 556 } 557 testGetSet_ushort2()558 public void testGetSet_ushort2() { 559 testSetup(Element.U16_2(mRS)); 560 short tmp[] = randomShortArray(gCount); 561 short tmp2[] = new short[gCount]; 562 script.forEach_copy1D_ushort2(walkAlloc); 563 verify(tmp, tmp2, out1DAlloc, "Data mismatch ushort2: ", 2); 564 scriptRelaxed.forEach_copy1D_ushort2(walkAlloc); 565 verify(tmp, tmp2, out1DAlloc, "Data mismatch relaxed ushort2: ", 2); 566 567 script.forEach_copy2D_ushort2(walkAlloc); 568 verify(tmp, tmp2, out2DAlloc, "Data mismatch ushort2: ", 2); 569 scriptRelaxed.forEach_copy2D_ushort2(walkAlloc); 570 verify(tmp, tmp2, out2DAlloc, "Data mismatch relaxed ushort2: ", 2); 571 572 script.forEach_copy3D_ushort2(walkAlloc); 573 verify(tmp, tmp2, out3DAlloc, "Data mismatch ushort2: ", 2); 574 scriptRelaxed.forEach_copy3D_ushort2(walkAlloc); 575 verify(tmp, tmp2, out3DAlloc, "Data mismatch relaxed ushort2: ", 2); 576 } 577 testGetSet_ushort3()578 public void testGetSet_ushort3() { 579 testSetup(Element.U16_3(mRS)); 580 short tmp[] = randomShortArray(gCount); 581 short tmp2[] = new short[gCount]; 582 script.forEach_copy1D_ushort3(walkAlloc); 583 verify(tmp, tmp2, out1DAlloc, "Data mismatch ushort3: ", 3); 584 scriptRelaxed.forEach_copy1D_ushort3(walkAlloc); 585 verify(tmp, tmp2, out1DAlloc, "Data mismatch relaxed ushort3: ", 3); 586 587 script.forEach_copy2D_ushort3(walkAlloc); 588 verify(tmp, tmp2, out2DAlloc, "Data mismatch ushort3: ", 3); 589 scriptRelaxed.forEach_copy2D_ushort3(walkAlloc); 590 verify(tmp, tmp2, out2DAlloc, "Data mismatch relaxed ushort3: ", 3); 591 592 script.forEach_copy3D_ushort3(walkAlloc); 593 verify(tmp, tmp2, out3DAlloc, "Data mismatch ushort3: ", 3); 594 scriptRelaxed.forEach_copy3D_ushort3(walkAlloc); 595 verify(tmp, tmp2, out3DAlloc, "Data mismatch relaxed ushort3: ", 3); 596 } 597 testGetSet_ushort4()598 public void testGetSet_ushort4() { 599 testSetup(Element.U16_4(mRS)); 600 short tmp[] = randomShortArray(gCount); 601 short tmp2[] = new short[gCount]; 602 script.forEach_copy1D_ushort4(walkAlloc); 603 verify(tmp, tmp2, out1DAlloc, "Data mismatch ushort4: ", 4); 604 scriptRelaxed.forEach_copy1D_ushort4(walkAlloc); 605 verify(tmp, tmp2, out1DAlloc, "Data mismatch relaxed ushort4: ", 4); 606 607 script.forEach_copy2D_ushort4(walkAlloc); 608 verify(tmp, tmp2, out2DAlloc, "Data mismatch ushort4: ", 4); 609 scriptRelaxed.forEach_copy2D_ushort4(walkAlloc); 610 verify(tmp, tmp2, out2DAlloc, "Data mismatch relaxed ushort4: ", 4); 611 612 script.forEach_copy3D_ushort4(walkAlloc); 613 verify(tmp, tmp2, out3DAlloc, "Data mismatch ushort4: ", 4); 614 scriptRelaxed.forEach_copy3D_ushort4(walkAlloc); 615 verify(tmp, tmp2, out3DAlloc, "Data mismatch relaxed ushort4: ", 4); 616 } 617 618 619 620 testGetSet_int()621 public void testGetSet_int() { 622 testSetup(Element.I32(mRS)); 623 int tmp[] = randomIntArray(gCount); 624 int tmp2[] = new int[gCount]; 625 script.forEach_copy1D_int(walkAlloc); 626 verify(tmp, tmp2, out1DAlloc, "Data mismatch int: ", 1); 627 scriptRelaxed.forEach_copy1D_int(walkAlloc); 628 verify(tmp, tmp2, out1DAlloc, "Data mismatch relaxed int: ", 1); 629 630 script.forEach_copy2D_int(walkAlloc); 631 verify(tmp, tmp2, out2DAlloc, "Data mismatch int: ", 1); 632 scriptRelaxed.forEach_copy2D_int(walkAlloc); 633 verify(tmp, tmp2, out2DAlloc, "Data mismatch relaxed int: ", 1); 634 635 script.forEach_copy3D_int(walkAlloc); 636 verify(tmp, tmp2, out3DAlloc, "Data mismatch int: ", 1); 637 scriptRelaxed.forEach_copy3D_int(walkAlloc); 638 verify(tmp, tmp2, out3DAlloc, "Data mismatch relaxed int: ", 1); 639 } 640 testGetSet_int2()641 public void testGetSet_int2() { 642 testSetup(Element.I32_2(mRS)); 643 int tmp[] = randomIntArray(gCount); 644 int tmp2[] = new int[gCount]; 645 script.forEach_copy1D_int2(walkAlloc); 646 verify(tmp, tmp2, out1DAlloc, "Data mismatch int2: ", 2); 647 scriptRelaxed.forEach_copy1D_int2(walkAlloc); 648 verify(tmp, tmp2, out1DAlloc, "Data mismatch relaxed int2: ", 2); 649 650 script.forEach_copy2D_int2(walkAlloc); 651 verify(tmp, tmp2, out2DAlloc, "Data mismatch int2: ", 2); 652 scriptRelaxed.forEach_copy2D_int2(walkAlloc); 653 verify(tmp, tmp2, out2DAlloc, "Data mismatch relaxed int2: ", 2); 654 655 script.forEach_copy3D_int2(walkAlloc); 656 verify(tmp, tmp2, out3DAlloc, "Data mismatch int2: ", 2); 657 scriptRelaxed.forEach_copy3D_int2(walkAlloc); 658 verify(tmp, tmp2, out3DAlloc, "Data mismatch relaxed int2: ", 2); 659 } 660 testGetSet_int3()661 public void testGetSet_int3() { 662 testSetup(Element.I32_3(mRS)); 663 int tmp[] = randomIntArray(gCount); 664 int tmp2[] = new int[gCount]; 665 script.forEach_copy1D_int3(walkAlloc); 666 verify(tmp, tmp2, out1DAlloc, "Data mismatch int3: ", 3); 667 scriptRelaxed.forEach_copy1D_int3(walkAlloc); 668 verify(tmp, tmp2, out1DAlloc, "Data mismatch relaxed int3: ", 3); 669 670 script.forEach_copy2D_int3(walkAlloc); 671 verify(tmp, tmp2, out2DAlloc, "Data mismatch int3: ", 3); 672 scriptRelaxed.forEach_copy2D_int3(walkAlloc); 673 verify(tmp, tmp2, out2DAlloc, "Data mismatch relaxed int3: ", 3); 674 675 script.forEach_copy3D_int3(walkAlloc); 676 verify(tmp, tmp2, out3DAlloc, "Data mismatch int3: ", 3); 677 scriptRelaxed.forEach_copy3D_int3(walkAlloc); 678 verify(tmp, tmp2, out3DAlloc, "Data mismatch relaxed int3: ", 3); 679 } 680 testGetSet_int4()681 public void testGetSet_int4() { 682 testSetup(Element.I32_4(mRS)); 683 int tmp[] = randomIntArray(gCount); 684 int tmp2[] = new int[gCount]; 685 script.forEach_copy1D_int4(walkAlloc); 686 verify(tmp, tmp2, out1DAlloc, "Data mismatch int4: ", 4); 687 scriptRelaxed.forEach_copy1D_int4(walkAlloc); 688 verify(tmp, tmp2, out1DAlloc, "Data mismatch relaxed int4: ", 4); 689 690 script.forEach_copy2D_int4(walkAlloc); 691 verify(tmp, tmp2, out2DAlloc, "Data mismatch int4: ", 4); 692 scriptRelaxed.forEach_copy2D_int4(walkAlloc); 693 verify(tmp, tmp2, out2DAlloc, "Data mismatch relaxed int4: ", 4); 694 695 script.forEach_copy3D_int4(walkAlloc); 696 verify(tmp, tmp2, out3DAlloc, "Data mismatch int4: ", 4); 697 scriptRelaxed.forEach_copy3D_int4(walkAlloc); 698 verify(tmp, tmp2, out3DAlloc, "Data mismatch relaxed int4: ", 4); 699 } 700 testGetSet_uint()701 public void testGetSet_uint() { 702 testSetup(Element.U32(mRS)); 703 int tmp[] = randomIntArray(gCount); 704 int tmp2[] = new int[gCount]; 705 script.forEach_copy1D_uint(walkAlloc); 706 verify(tmp, tmp2, out1DAlloc, "Data mismatch uint: ", 1); 707 scriptRelaxed.forEach_copy1D_uint(walkAlloc); 708 verify(tmp, tmp2, out1DAlloc, "Data mismatch relaxed uint: ", 1); 709 710 script.forEach_copy2D_uint(walkAlloc); 711 verify(tmp, tmp2, out2DAlloc, "Data mismatch uint: ", 1); 712 scriptRelaxed.forEach_copy2D_uint(walkAlloc); 713 verify(tmp, tmp2, out2DAlloc, "Data mismatch relaxed uint: ", 1); 714 715 script.forEach_copy3D_uint(walkAlloc); 716 verify(tmp, tmp2, out3DAlloc, "Data mismatch uint: ", 1); 717 scriptRelaxed.forEach_copy3D_uint(walkAlloc); 718 verify(tmp, tmp2, out3DAlloc, "Data mismatch relaxed uint: ", 1); 719 } 720 testGetSet_uint2()721 public void testGetSet_uint2() { 722 testSetup(Element.U32_2(mRS)); 723 int tmp[] = randomIntArray(gCount); 724 int tmp2[] = new int[gCount]; 725 script.forEach_copy1D_uint2(walkAlloc); 726 verify(tmp, tmp2, out1DAlloc, "Data mismatch uint2: ", 2); 727 scriptRelaxed.forEach_copy1D_uint2(walkAlloc); 728 verify(tmp, tmp2, out1DAlloc, "Data mismatch relaxed uint2: ", 2); 729 730 script.forEach_copy2D_uint2(walkAlloc); 731 verify(tmp, tmp2, out2DAlloc, "Data mismatch uint2: ", 2); 732 scriptRelaxed.forEach_copy2D_uint2(walkAlloc); 733 verify(tmp, tmp2, out2DAlloc, "Data mismatch relaxed uint2: ", 2); 734 735 script.forEach_copy3D_uint2(walkAlloc); 736 verify(tmp, tmp2, out3DAlloc, "Data mismatch uint2: ", 2); 737 scriptRelaxed.forEach_copy3D_uint2(walkAlloc); 738 verify(tmp, tmp2, out3DAlloc, "Data mismatch relaxed uint2: ", 2); 739 } 740 testGetSet_uint3()741 public void testGetSet_uint3() { 742 testSetup(Element.U32_3(mRS)); 743 int tmp[] = randomIntArray(gCount); 744 int tmp2[] = new int[gCount]; 745 script.forEach_copy1D_uint3(walkAlloc); 746 verify(tmp, tmp2, out1DAlloc, "Data mismatch uint3: ", 3); 747 scriptRelaxed.forEach_copy1D_uint3(walkAlloc); 748 verify(tmp, tmp2, out1DAlloc, "Data mismatch relaxed uint3: ", 3); 749 750 script.forEach_copy2D_uint3(walkAlloc); 751 verify(tmp, tmp2, out2DAlloc, "Data mismatch uint3: ", 3); 752 scriptRelaxed.forEach_copy2D_uint3(walkAlloc); 753 verify(tmp, tmp2, out2DAlloc, "Data mismatch relaxed uint3: ", 3); 754 755 script.forEach_copy3D_uint3(walkAlloc); 756 verify(tmp, tmp2, out3DAlloc, "Data mismatch uint3: ", 3); 757 scriptRelaxed.forEach_copy3D_uint3(walkAlloc); 758 verify(tmp, tmp2, out3DAlloc, "Data mismatch relaxed uint3: ", 3); 759 } 760 testGetSet_uint4()761 public void testGetSet_uint4() { 762 testSetup(Element.U32_4(mRS)); 763 int tmp[] = randomIntArray(gCount); 764 int tmp2[] = new int[gCount]; 765 script.forEach_copy1D_uint4(walkAlloc); 766 verify(tmp, tmp2, out1DAlloc, "Data mismatch uint4: ", 4); 767 scriptRelaxed.forEach_copy1D_uint4(walkAlloc); 768 verify(tmp, tmp2, out1DAlloc, "Data mismatch relaxed uint4: ", 4); 769 770 script.forEach_copy2D_uint4(walkAlloc); 771 verify(tmp, tmp2, out2DAlloc, "Data mismatch uint4: ", 4); 772 scriptRelaxed.forEach_copy2D_uint4(walkAlloc); 773 verify(tmp, tmp2, out2DAlloc, "Data mismatch relaxed uint4: ", 4); 774 775 script.forEach_copy3D_uint4(walkAlloc); 776 verify(tmp, tmp2, out3DAlloc, "Data mismatch uint4: ", 4); 777 scriptRelaxed.forEach_copy3D_uint4(walkAlloc); 778 verify(tmp, tmp2, out3DAlloc, "Data mismatch relaxed uint4: ", 4); 779 } 780 781 782 783 testGetSet_long()784 public void testGetSet_long() { 785 testSetup(Element.I64(mRS)); 786 long tmp[] = randomLongArray(gCount); 787 long tmp2[] = new long[gCount]; 788 script.forEach_copy1D_long(walkAlloc); 789 verify(tmp, tmp2, out1DAlloc, "Data mismatch long: ", 1); 790 scriptRelaxed.forEach_copy1D_long(walkAlloc); 791 verify(tmp, tmp2, out1DAlloc, "Data mismatch relaxed long: ", 1); 792 793 script.forEach_copy2D_long(walkAlloc); 794 verify(tmp, tmp2, out2DAlloc, "Data mismatch long: ", 1); 795 scriptRelaxed.forEach_copy2D_long(walkAlloc); 796 verify(tmp, tmp2, out2DAlloc, "Data mismatch relaxed long: ", 1); 797 798 script.forEach_copy3D_long(walkAlloc); 799 verify(tmp, tmp2, out3DAlloc, "Data mismatch long: ", 1); 800 scriptRelaxed.forEach_copy3D_long(walkAlloc); 801 verify(tmp, tmp2, out3DAlloc, "Data mismatch relaxed long: ", 1); 802 } 803 testGetSet_long2()804 public void testGetSet_long2() { 805 testSetup(Element.I64_2(mRS)); 806 long tmp[] = randomLongArray(gCount); 807 long tmp2[] = new long[gCount]; 808 script.forEach_copy1D_long2(walkAlloc); 809 verify(tmp, tmp2, out1DAlloc, "Data mismatch long2: ", 2); 810 scriptRelaxed.forEach_copy1D_long2(walkAlloc); 811 verify(tmp, tmp2, out1DAlloc, "Data mismatch relaxed long2: ", 2); 812 813 script.forEach_copy2D_long2(walkAlloc); 814 verify(tmp, tmp2, out2DAlloc, "Data mismatch long2: ", 2); 815 scriptRelaxed.forEach_copy2D_long2(walkAlloc); 816 verify(tmp, tmp2, out2DAlloc, "Data mismatch relaxed long2: ", 2); 817 818 script.forEach_copy3D_long2(walkAlloc); 819 verify(tmp, tmp2, out3DAlloc, "Data mismatch long2: ", 2); 820 scriptRelaxed.forEach_copy3D_long2(walkAlloc); 821 verify(tmp, tmp2, out3DAlloc, "Data mismatch relaxed long2: ", 2); 822 } 823 testGetSet_long3()824 public void testGetSet_long3() { 825 testSetup(Element.I64_3(mRS)); 826 long tmp[] = randomLongArray(gCount); 827 long tmp2[] = new long[gCount]; 828 script.forEach_copy1D_long3(walkAlloc); 829 verify(tmp, tmp2, out1DAlloc, "Data mismatch long3: ", 3); 830 scriptRelaxed.forEach_copy1D_long3(walkAlloc); 831 verify(tmp, tmp2, out1DAlloc, "Data mismatch relaxed long3: ", 3); 832 833 script.forEach_copy2D_long3(walkAlloc); 834 verify(tmp, tmp2, out2DAlloc, "Data mismatch long3: ", 3); 835 scriptRelaxed.forEach_copy2D_long3(walkAlloc); 836 verify(tmp, tmp2, out2DAlloc, "Data mismatch relaxed long3: ", 3); 837 838 script.forEach_copy3D_long3(walkAlloc); 839 verify(tmp, tmp2, out3DAlloc, "Data mismatch long3: ", 3); 840 scriptRelaxed.forEach_copy3D_long3(walkAlloc); 841 verify(tmp, tmp2, out3DAlloc, "Data mismatch relaxed long3: ", 3); 842 } 843 testGetSet_long4()844 public void testGetSet_long4() { 845 testSetup(Element.I64_4(mRS)); 846 long tmp[] = randomLongArray(gCount); 847 long tmp2[] = new long[gCount]; 848 script.forEach_copy1D_long4(walkAlloc); 849 verify(tmp, tmp2, out1DAlloc, "Data mismatch long4: ", 4); 850 scriptRelaxed.forEach_copy1D_long4(walkAlloc); 851 verify(tmp, tmp2, out1DAlloc, "Data mismatch relaxed long4: ", 4); 852 853 script.forEach_copy2D_long4(walkAlloc); 854 verify(tmp, tmp2, out2DAlloc, "Data mismatch long4: ", 4); 855 scriptRelaxed.forEach_copy2D_long4(walkAlloc); 856 verify(tmp, tmp2, out2DAlloc, "Data mismatch relaxed long4: ", 4); 857 858 script.forEach_copy3D_long4(walkAlloc); 859 verify(tmp, tmp2, out3DAlloc, "Data mismatch long4: ", 4); 860 scriptRelaxed.forEach_copy3D_long4(walkAlloc); 861 verify(tmp, tmp2, out3DAlloc, "Data mismatch relaxed long4: ", 4); 862 } 863 testGetSet_ulong()864 public void testGetSet_ulong() { 865 testSetup(Element.U64(mRS)); 866 long tmp[] = randomLongArray(gCount); 867 long tmp2[] = new long[gCount]; 868 script.forEach_copy1D_ulong(walkAlloc); 869 verify(tmp, tmp2, out1DAlloc, "Data mismatch ulong: ", 1); 870 scriptRelaxed.forEach_copy1D_ulong(walkAlloc); 871 verify(tmp, tmp2, out1DAlloc, "Data mismatch relaxed ulong: ", 1); 872 873 script.forEach_copy2D_ulong(walkAlloc); 874 verify(tmp, tmp2, out2DAlloc, "Data mismatch ulong: ", 1); 875 scriptRelaxed.forEach_copy2D_ulong(walkAlloc); 876 verify(tmp, tmp2, out2DAlloc, "Data mismatch relaxed ulong: ", 1); 877 878 script.forEach_copy3D_ulong(walkAlloc); 879 verify(tmp, tmp2, out3DAlloc, "Data mismatch ulong: ", 1); 880 scriptRelaxed.forEach_copy3D_ulong(walkAlloc); 881 verify(tmp, tmp2, out3DAlloc, "Data mismatch relaxed ulong: ", 1); 882 } 883 testGetSet_ulong2()884 public void testGetSet_ulong2() { 885 testSetup(Element.U64_2(mRS)); 886 long tmp[] = randomLongArray(gCount); 887 long tmp2[] = new long[gCount]; 888 script.forEach_copy1D_ulong2(walkAlloc); 889 verify(tmp, tmp2, out1DAlloc, "Data mismatch ulong2: ", 2); 890 scriptRelaxed.forEach_copy1D_ulong2(walkAlloc); 891 verify(tmp, tmp2, out1DAlloc, "Data mismatch relaxed ulong2: ", 2); 892 893 script.forEach_copy2D_ulong2(walkAlloc); 894 verify(tmp, tmp2, out2DAlloc, "Data mismatch ulong2: ", 2); 895 scriptRelaxed.forEach_copy2D_ulong2(walkAlloc); 896 verify(tmp, tmp2, out2DAlloc, "Data mismatch relaxed ulong2: ", 2); 897 898 script.forEach_copy3D_ulong2(walkAlloc); 899 verify(tmp, tmp2, out3DAlloc, "Data mismatch ulong2: ", 2); 900 scriptRelaxed.forEach_copy3D_ulong2(walkAlloc); 901 verify(tmp, tmp2, out3DAlloc, "Data mismatch relaxed ulong2: ", 2); 902 } 903 testGetSet_ulong3()904 public void testGetSet_ulong3() { 905 testSetup(Element.U64_3(mRS)); 906 long tmp[] = randomLongArray(gCount); 907 long tmp2[] = new long[gCount]; 908 script.forEach_copy1D_ulong3(walkAlloc); 909 verify(tmp, tmp2, out1DAlloc, "Data mismatch ulong3: ", 3); 910 scriptRelaxed.forEach_copy1D_ulong3(walkAlloc); 911 verify(tmp, tmp2, out1DAlloc, "Data mismatch relaxed ulong3: ", 3); 912 913 script.forEach_copy2D_ulong3(walkAlloc); 914 verify(tmp, tmp2, out2DAlloc, "Data mismatch ulong3: ", 3); 915 scriptRelaxed.forEach_copy2D_ulong3(walkAlloc); 916 verify(tmp, tmp2, out2DAlloc, "Data mismatch relaxed ulong3: ", 3); 917 918 script.forEach_copy3D_ulong3(walkAlloc); 919 verify(tmp, tmp2, out3DAlloc, "Data mismatch ulong3: ", 3); 920 scriptRelaxed.forEach_copy3D_ulong3(walkAlloc); 921 verify(tmp, tmp2, out3DAlloc, "Data mismatch relaxed ulong3: ", 3); 922 } 923 testGetSet_ulong4()924 public void testGetSet_ulong4() { 925 testSetup(Element.U64_4(mRS)); 926 long tmp[] = randomLongArray(gCount); 927 long tmp2[] = new long[gCount]; 928 script.forEach_copy1D_ulong4(walkAlloc); 929 verify(tmp, tmp2, out1DAlloc, "Data mismatch ulong4: ", 4); 930 scriptRelaxed.forEach_copy1D_ulong4(walkAlloc); 931 verify(tmp, tmp2, out1DAlloc, "Data mismatch relaxed ulong4: ", 4); 932 933 script.forEach_copy2D_ulong4(walkAlloc); 934 verify(tmp, tmp2, out2DAlloc, "Data mismatch ulong4: ", 4); 935 scriptRelaxed.forEach_copy2D_ulong4(walkAlloc); 936 verify(tmp, tmp2, out2DAlloc, "Data mismatch relaxed ulong4: ", 4); 937 938 script.forEach_copy3D_ulong4(walkAlloc); 939 verify(tmp, tmp2, out3DAlloc, "Data mismatch ulong4: ", 4); 940 scriptRelaxed.forEach_copy3D_ulong4(walkAlloc); 941 verify(tmp, tmp2, out3DAlloc, "Data mismatch relaxed ulong4: ", 4); 942 } 943 944 945 946 testGetSet_float()947 public void testGetSet_float() { 948 testSetup(Element.F32(mRS)); 949 float tmp[] = randomFloatArray(gCount); 950 float tmp2[] = new float[gCount]; 951 script.forEach_copy1D_float(walkAlloc); 952 verify(tmp, tmp2, out1DAlloc, "Data mismatch float: ", 1); 953 scriptRelaxed.forEach_copy1D_float(walkAlloc); 954 verify(tmp, tmp2, out1DAlloc, "Data mismatch relaxed float: ", 1); 955 956 script.forEach_copy2D_float(walkAlloc); 957 verify(tmp, tmp2, out2DAlloc, "Data mismatch float: ", 1); 958 scriptRelaxed.forEach_copy2D_float(walkAlloc); 959 verify(tmp, tmp2, out2DAlloc, "Data mismatch relaxed float: ", 1); 960 961 script.forEach_copy3D_float(walkAlloc); 962 verify(tmp, tmp2, out3DAlloc, "Data mismatch float: ", 1); 963 scriptRelaxed.forEach_copy3D_float(walkAlloc); 964 verify(tmp, tmp2, out3DAlloc, "Data mismatch relaxed float: ", 1); 965 } 966 testGetSet_float2()967 public void testGetSet_float2() { 968 testSetup(Element.F32_2(mRS)); 969 float tmp[] = randomFloatArray(gCount); 970 float tmp2[] = new float[gCount]; 971 script.forEach_copy1D_float2(walkAlloc); 972 verify(tmp, tmp2, out1DAlloc, "Data mismatch float2: ", 2); 973 scriptRelaxed.forEach_copy1D_float2(walkAlloc); 974 verify(tmp, tmp2, out1DAlloc, "Data mismatch relaxed float2: ", 2); 975 976 script.forEach_copy2D_float2(walkAlloc); 977 verify(tmp, tmp2, out2DAlloc, "Data mismatch float2: ", 2); 978 scriptRelaxed.forEach_copy2D_float2(walkAlloc); 979 verify(tmp, tmp2, out2DAlloc, "Data mismatch relaxed float2: ", 2); 980 981 script.forEach_copy3D_float2(walkAlloc); 982 verify(tmp, tmp2, out3DAlloc, "Data mismatch float2: ", 2); 983 scriptRelaxed.forEach_copy3D_float2(walkAlloc); 984 verify(tmp, tmp2, out3DAlloc, "Data mismatch relaxed float2: ", 2); 985 } 986 testGetSet_float3()987 public void testGetSet_float3() { 988 testSetup(Element.F32_3(mRS)); 989 float tmp[] = randomFloatArray(gCount); 990 float tmp2[] = new float[gCount]; 991 script.forEach_copy1D_float3(walkAlloc); 992 verify(tmp, tmp2, out1DAlloc, "Data mismatch float3: ", 3); 993 scriptRelaxed.forEach_copy1D_float3(walkAlloc); 994 verify(tmp, tmp2, out1DAlloc, "Data mismatch relaxed float3: ", 3); 995 996 script.forEach_copy2D_float3(walkAlloc); 997 verify(tmp, tmp2, out2DAlloc, "Data mismatch float3: ", 3); 998 scriptRelaxed.forEach_copy2D_float3(walkAlloc); 999 verify(tmp, tmp2, out2DAlloc, "Data mismatch relaxed float3: ", 3); 1000 1001 script.forEach_copy3D_float3(walkAlloc); 1002 verify(tmp, tmp2, out3DAlloc, "Data mismatch float3: ", 3); 1003 scriptRelaxed.forEach_copy3D_float3(walkAlloc); 1004 verify(tmp, tmp2, out3DAlloc, "Data mismatch relaxed float3: ", 3); 1005 } 1006 testGetSet_float4()1007 public void testGetSet_float4() { 1008 testSetup(Element.F32_4(mRS)); 1009 float tmp[] = randomFloatArray(gCount); 1010 float tmp2[] = new float[gCount]; 1011 script.forEach_copy1D_float4(walkAlloc); 1012 verify(tmp, tmp2, out1DAlloc, "Data mismatch float4: ", 4); 1013 scriptRelaxed.forEach_copy1D_float4(walkAlloc); 1014 verify(tmp, tmp2, out1DAlloc, "Data mismatch relaxed float4: ", 4); 1015 1016 script.forEach_copy2D_float4(walkAlloc); 1017 verify(tmp, tmp2, out2DAlloc, "Data mismatch float4: ", 4); 1018 scriptRelaxed.forEach_copy2D_float4(walkAlloc); 1019 verify(tmp, tmp2, out2DAlloc, "Data mismatch relaxed float4: ", 4); 1020 1021 script.forEach_copy3D_float4(walkAlloc); 1022 verify(tmp, tmp2, out3DAlloc, "Data mismatch float4: ", 4); 1023 scriptRelaxed.forEach_copy3D_float4(walkAlloc); 1024 verify(tmp, tmp2, out3DAlloc, "Data mismatch relaxed float4: ", 4); 1025 } 1026 1027 testGetSet_double()1028 public void testGetSet_double() { 1029 testSetup(Element.F64(mRS)); 1030 double tmp[] = randomDoubleArray(gCount); 1031 double tmp2[] = new double[gCount]; 1032 script.forEach_copy1D_double(walkAlloc); 1033 verify(tmp, tmp2, out1DAlloc, "Data mismatch double: ", 1); 1034 scriptRelaxed.forEach_copy1D_double(walkAlloc); 1035 verify(tmp, tmp2, out1DAlloc, "Data mismatch relaxed double: ", 1); 1036 1037 script.forEach_copy2D_double(walkAlloc); 1038 verify(tmp, tmp2, out2DAlloc, "Data mismatch double: ", 1); 1039 scriptRelaxed.forEach_copy2D_double(walkAlloc); 1040 verify(tmp, tmp2, out2DAlloc, "Data mismatch relaxed double: ", 1); 1041 1042 script.forEach_copy3D_double(walkAlloc); 1043 verify(tmp, tmp2, out3DAlloc, "Data mismatch double: ", 1); 1044 scriptRelaxed.forEach_copy3D_double(walkAlloc); 1045 verify(tmp, tmp2, out3DAlloc, "Data mismatch relaxed double: ", 1); 1046 } 1047 testGetSet_double2()1048 public void testGetSet_double2() { 1049 testSetup(Element.F64_2(mRS)); 1050 double tmp[] = randomDoubleArray(gCount); 1051 double tmp2[] = new double[gCount]; 1052 script.forEach_copy1D_double2(walkAlloc); 1053 verify(tmp, tmp2, out1DAlloc, "Data mismatch double2: ", 2); 1054 scriptRelaxed.forEach_copy1D_double2(walkAlloc); 1055 verify(tmp, tmp2, out1DAlloc, "Data mismatch relaxed double2: ", 2); 1056 1057 script.forEach_copy2D_double2(walkAlloc); 1058 verify(tmp, tmp2, out2DAlloc, "Data mismatch double2: ", 2); 1059 scriptRelaxed.forEach_copy2D_double2(walkAlloc); 1060 verify(tmp, tmp2, out2DAlloc, "Data mismatch relaxed double2: ", 2); 1061 1062 script.forEach_copy3D_double2(walkAlloc); 1063 verify(tmp, tmp2, out3DAlloc, "Data mismatch double2: ", 2); 1064 scriptRelaxed.forEach_copy3D_double2(walkAlloc); 1065 verify(tmp, tmp2, out3DAlloc, "Data mismatch relaxed double2: ", 2); 1066 } 1067 testGetSet_double3()1068 public void testGetSet_double3() { 1069 testSetup(Element.F64_3(mRS)); 1070 double tmp[] = randomDoubleArray(gCount); 1071 double tmp2[] = new double[gCount]; 1072 script.forEach_copy1D_double3(walkAlloc); 1073 verify(tmp, tmp2, out1DAlloc, "Data mismatch double3: ", 3); 1074 scriptRelaxed.forEach_copy1D_double3(walkAlloc); 1075 verify(tmp, tmp2, out1DAlloc, "Data mismatch relaxed double3: ", 3); 1076 1077 script.forEach_copy2D_double3(walkAlloc); 1078 verify(tmp, tmp2, out2DAlloc, "Data mismatch double3: ", 3); 1079 scriptRelaxed.forEach_copy2D_double3(walkAlloc); 1080 verify(tmp, tmp2, out2DAlloc, "Data mismatch relaxed double3: ", 3); 1081 1082 script.forEach_copy3D_double3(walkAlloc); 1083 verify(tmp, tmp2, out3DAlloc, "Data mismatch double3: ", 3); 1084 scriptRelaxed.forEach_copy3D_double3(walkAlloc); 1085 verify(tmp, tmp2, out3DAlloc, "Data mismatch relaxed double3: ", 3); 1086 } 1087 testGetSet_double4()1088 public void testGetSet_double4() { 1089 testSetup(Element.F64_4(mRS)); 1090 double tmp[] = randomDoubleArray(gCount); 1091 double tmp2[] = new double[gCount]; 1092 script.forEach_copy1D_double4(walkAlloc); 1093 verify(tmp, tmp2, out1DAlloc, "Data mismatch double4: ", 4); 1094 scriptRelaxed.forEach_copy1D_double4(walkAlloc); 1095 verify(tmp, tmp2, out1DAlloc, "Data mismatch relaxed double4: ", 4); 1096 1097 script.forEach_copy2D_double4(walkAlloc); 1098 verify(tmp, tmp2, out2DAlloc, "Data mismatch double4: ", 4); 1099 scriptRelaxed.forEach_copy2D_double4(walkAlloc); 1100 verify(tmp, tmp2, out2DAlloc, "Data mismatch relaxed double4: ", 4); 1101 1102 script.forEach_copy3D_double4(walkAlloc); 1103 verify(tmp, tmp2, out3DAlloc, "Data mismatch double4: ", 4); 1104 scriptRelaxed.forEach_copy3D_double4(walkAlloc); 1105 verify(tmp, tmp2, out3DAlloc, "Data mismatch relaxed double4: ", 4); 1106 } 1107 1108 1109 } 1110