File: launch-9.ispc

package info (click to toggle)
ispc 1.28.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 97,620 kB
  • sloc: cpp: 77,067; python: 8,303; yacc: 3,337; lex: 1,126; ansic: 631; sh: 475; makefile: 17
file content (43 lines) | stat: -rw-r--r-- 1,239 bytes parent folder | download | duplicates (2)
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
#include "test_static.isph"
// rule: skip on arch=xe64

#define N0 12
#define N1 20
#define N2 50
static uniform float array[N2][N1][N0];

task void x(const uniform float farray[]) {
    const float f = farray[programIndex];
    uniform int j;

    assert(taskCount  == (int32)N0*N1*N2);
    assert(taskCount0 == (int32)N0);
    assert(taskCount1 == (int32)N1);
    assert(taskCount2 == (int32)N2);
    assert(taskIndex  == (int32)taskIndex0 + (int32)N0*(taskIndex1 +(int32) N1*taskIndex2));
    assert(taskIndex0 < (int32)N0);
    assert(taskIndex1 < (int32)N1);
    assert(taskIndex2 < (int32)N2);

    const uniform int i0 = taskIndex0;
    const uniform int i1 = taskIndex1;
    const uniform int i2 = taskIndex2;
    const uniform int i  = taskIndex;
    array[i2][i1][i0] = i / 10000.;
    #pragma ignore warning
    cfor (j = 0; j < 10000; ++j)
        array[i2][i1][i0] = sin(array[i2][i1][i0]);
    if (array[i2][i1][i0] < .02)
        array[i2][i1][i0] = i;
}
task void f_f(uniform float RET[], uniform float fFOO[]) {
    uniform float * uniform f = fFOO;
    launch[N2][N1][N0] x(f);
    sync;
    RET[programIndex] = array[N2-1][N1-1][N0-1];
}


task void result(uniform float RET[]) {
    RET[programIndex] = 11999.000000;
}