< prev index next >

test/jdk/jdk/incubator/vector/templates/Unit-Slice-op.template

Print this page


 1     static $type$[] [[TEST]]($type$[] a, int origin, int idx) {
 2         $type$[] res = new $type$[SPECIES.length()];
 3         for (int i = 0; i < SPECIES.length(); i++){
 4             if(i+origin < SPECIES.length())
 5                 res[i] = a[idx+i+origin];
 6             else
 7                 res[i] = ($type$)0;
 8         }
 9         return res;
10     }
11 
12     @Test(dataProvider = "$type$UnaryOpProvider")
13     static void [[TEST]]$vectorteststype$(IntFunction<$type$[]> fa) {
14 [[KERNEL]]
15         assertArraysEquals(r, a, origin, $vectorteststype$::[[TEST]]);
16     }

 1 
 2     static $type$[] [[TEST]]($type$[] a, int origin, int idx) {
 3         $type$[] res = new $type$[SPECIES.length()];
 4         for (int i = 0; i < SPECIES.length(); i++){
 5             if(i+origin < SPECIES.length())
 6                 res[i] = a[idx+i+origin];
 7             else
 8                 res[i] = ($type$)0;
 9         }
10         return res;
11     }
12 
13     @Test(dataProvider = "$type$UnaryOpProvider")
14     static void [[TEST]]$vectorteststype$(IntFunction<$type$[]> fa) {
15 [[KERNEL]]
16         assertArraysEquals(r, a, origin, $vectorteststype$::[[TEST]]);
17     }
< prev index next >