summaryrefslogtreecommitdiffstats
path: root/Tests/ISPC/ObjectGenex/simple.ispc
blob: a76b76cfee558e953f3ef230499ff34702a0824c (plain)
1
2
3
4
5
6
7
8
9
10
11
12

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;
    }
}