aboutsummaryrefslogtreecommitdiff
path: root/examples/ispc/Max_array.ispc
blob: 75ebb5f86c060954edaf419bef2138f27e7d4f33 (plain)
1
2
3
4
5
6
7
8
9
// Compile with --opt=force-aligned-memory to improve vectorization
// by assuming the input arrays are aligned. SSE, AVX and AVX-512
// targets will assume 16, 32 or 64 byte alignment respectively.

void maxArray(uniform double x[], uniform double y[]) {
    foreach (i = 0 ... 65536) {
        x[i] = max(x[i], y[i]);
    }
}