File: operators3.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-- 802 bytes parent folder | download
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"

struct S {
    uint a;
};

uint operator==(struct S rr, struct S rv) {
    return rr.a == rv.a;
}

uint operator!=(struct S rr, struct S rv) {
    return rr.a != rv.a;
}

uint operator>(struct S rr, struct S rv) {
    return rr.a > rv.a;
}

uint operator<(struct S rr, struct S rv) {
    return rr.a < rv.a;
}

uint operator>=(struct S rr, struct S rv) {
    return rr.a >= rv.a;
}

uint operator<=(struct S rr, struct S rv) {
    return rr.a <= rv.a;
}

task void f_f(uniform float RET[], uniform float aFOO[]) {
    struct S a;
    struct S b;

    a.a = aFOO[programIndex];
    b.a = aFOO[programIndex] + 5;

    RET[programIndex] = (a == b) + (a != b) + (a > b) + (a < b) + (a >= b) + (a <= b);
}

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