aboutsummaryrefslogtreecommitdiff
path: root/tests/cl/program/execute/vector-arithmetic-float4.program_test
blob: c2e614a523a753080e673db804927b781050bef1 (plain)
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
[config]
name: Float4 arithmetic
clc_version_min: 10

program_source_file: vector-arithmetic-floating.cl.inc
build_options: -D VECTOR_TYPE=float4

dimensions: 1
global_size: 1 0 0

## Addition ##

[test]
name: pos+pos, neg+neg
kernel_name: add
arg_in:  1 float4            1  2 -3 -5
arg_in:  2 float4            2  3 -4 -1
arg_out: 0 buffer float4[1]  3  5 -7 -6

[test]
name: pos+neg, neg+pos
kernel_name: add
arg_in:  1 float4            5  6 -4 -7
arg_in:  2 float4           -5 -4  1  8
arg_out: 0 buffer float4[1]  0  2 -3  1

[test]
name: inf+inf, -inf+-inf, inf+-inf, -inf+inf
kernel_name: add
arg_in:  1 float4            inf -inf  inf -inf
arg_in:  2 float4            inf -inf -inf  inf
arg_out: 0 buffer float4[1]  inf -inf  nan  nan

## Subtraction ##

[test]
name: pos-pos, neg-neg
kernel_name: sub
arg_in:  1 float4            1  5 -5 -2
arg_in:  2 float4            2  3 -2 -4
arg_out: 0 buffer float4[1] -1  2 -3  2

[test]
name: pos-neg, neg-pos
kernel_name: sub
arg_in:  1 float4            3  5 -2 -6
arg_in:  2 float4           -4 -3  4  3
arg_out: 0 buffer float4[1]  7  8 -6 -9

[test]
name: 0-inf, 0--inf, inf--inf, -inf-inf
kernel_name: sub
arg_in:  1 float4              0    0  inf -inf
arg_in:  2 float4            inf -inf -inf  inf
arg_out: 0 buffer float4[1] -inf  inf  inf -inf

## Multiplication ##

[test]
name: pos*pos, neg*neg, pos*neg, neg*pos
kernel_name: mul
arg_in:  1 float4               3    -5   4.25  -6.75
arg_in:  2 float4            4.25  -5.5     -3      1
arg_out: 0 buffer float4[1] 12.75  27.5 -12.75  -6.75

[test]
name: 0*num, num*0
kernel_name: mul
arg_in:  1 float4            0     -1  5.25    0
arg_in:  2 float4           -3.125  0     0  6.5
arg_out: 0 buffer float4[1]  0      0     0    0

[test]
name: 0*inf, inf*inf, inf*-inf, -inf*-inf
kernel_name: mul
arg_in:  1 float4              0 -inf  inf -inf
arg_in:  2 float4            inf -inf -inf  inf
arg_out: 0 buffer float4[1]  nan  inf -inf -inf

[test]
name: num*nan
kernel_name: mul
arg_in:  1 float4            3.5  nan -4.5   nan
arg_in:  2 float4            nan 23.5  nan -6.25
arg_out: 0 buffer float4[1]  nan  nan  nan   nan

## Division ##

[test]
name: pos/pos, neg/neg, pos/neg, neg/pos
kernel_name: div
arg_in:  1 float4             8.5 -21.25 11.25  -21
arg_in:  2 float4            4.25     -5    -3 5.25
arg_out: 0 buffer float4[1]     2   4.25 -3.75   -4

[test]
name: 0/pos, 0/neg, pos/0, neg/0
kernel_name: div
arg_in:  1 float4               0  0 11.25  -21
arg_in:  2 float4            4.25 -5     0    0
arg_out: 0 buffer float4[1]     0  0   inf -inf

[test]
name: 0/inf, inf/0, inf/inf, nan/0
kernel_name: div
arg_in:  1 float4               0  inf inf nan
arg_in:  2 float4             inf    0 inf   0
arg_out: 0 buffer float4[1]     0  inf nan nan

## Unary plus ##

[test]
name: +pos, +neg, +inf, +-inf
kernel_name: plus
arg_in:  1 float4            345.25 -33.5 inf -inf
arg_out: 0 buffer float4[1]  345.25 -33.5 inf -inf

## Unary minus ##

[test]
name: -pos, -neg, -inf, --inf
kernel_name: minus
arg_in:  1 float4            345.25 -33.5  inf -inf
arg_out: 0 buffer float4[1] -345.25  33.5 -inf  inf