1 2 static $type$ [[TEST]]ReduceMasked($type$[] a, int idx, boolean[] mask) { 3 $type$ res = [[TEST_INIT]]; 4 for (int i = idx; i < (idx + SPECIES.length()); i++) { 5 if (mask[i % SPECIES.length()]) 6 res [[TEST_OP]]= a[i]; 7 } 8 9 return res; 10 } 11 12 static $type$ [[TEST]]ReduceAllMasked($type$[] a, boolean[] mask) { 13 $type$ res = [[TEST_INIT]]; 14 for (int i = 0; i < a.length; i += SPECIES.length()) { 15 res [[TEST_OP]]= [[TEST]]ReduceMasked(a, i, mask); 16 } 17 18 return res; 19 }