summaryrefslogtreecommitdiffstats
path: root/Tests/ISPC/Defines/simple.ispc
blob: d8d64656a6091c648a0f59467f12aa165ac53384 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15

//textual error if STRUCT_DEFINE not set
STRUCT_DEFINE;};

export void simple(uniform float vin[], uniform float vout[],
                   uniform int count) {
    foreach (index = 0 ... count) {
        float v = vin[index];
        if (v < M_PI)
            v = v * v;
        else
            v = sqrt(v);
        vout[index] = v;
    }
}