kernels.rs revision d10412f903f2aab730fa9bcbead471db4d7c2393
1/*
2 * Copyright (C) 2013 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#pragma version(1)
18#pragma rs java_package_name(com.android.rs.cppbasic)
19#pragma rs_fp_relaxed
20
21// Test initialized and uninitialized variables
22char c1;
23char c1i = 1;
24char2 c2;
25char2 c2i = {1, 2};
26char3 c3;
27char3 c3i = {1, 2, 3};
28char4 c4;
29char4 c4i = {1, 2, 3, 4};
30
31uchar uc1;
32uchar uc1i = 1;
33uchar2 uc2;
34uchar2 uc2i = {1, 2};
35uchar3 uc3;
36uchar3 uc3i = {1, 2, 3};
37uchar4 uc4;
38uchar4 uc4i = {1, 2, 3, 4};
39
40short s1;
41short s1i = 1;
42short2 s2;
43short2 s2i = {1, 2};
44short3 s3;
45short3 s3i = {1, 2, 3};
46short4 s4;
47short4 s4i = {1, 2, 3, 4};
48
49ushort us1;
50ushort us1i = 1;
51ushort2 us2;
52ushort2 us2i = {1, 2};
53ushort3 us3;
54ushort3 us3i = {1, 2, 3};
55ushort4 us4;
56ushort4 us4i = {1, 2, 3, 4};
57
58int i1;
59int i1i = 1;
60int2 i2;
61int2 i2i = {1, 2};
62int3 i3;
63int3 i3i = {1, 2, 3};
64int4 i4;
65int4 i4i = {1, 2, 3, 4};
66
67uint ui1;
68uint ui1i = 1;
69uint2 ui2;
70uint2 ui2i = {1, 2};
71uint3 ui3;
72uint3 ui3i = {1, 2, 3};
73uint4 ui4;
74uint4 ui4i = {1, 2, 3, 4};
75
76long l1;
77long l1i = 1;
78long2 l2;
79long2 l2i = {1, 2};
80long3 l3;
81long3 l3i = {1, 2, 3};
82long4 l4;
83long4 l4i = {1, 2, 3, 4};
84
85ulong ul1;
86ulong ul1i = 1;
87ulong2 ul2;
88ulong2 ul2i = {1, 2};
89ulong3 ul3;
90ulong3 ul3i = {1, 2, 3};
91ulong4 ul4;
92ulong4 ul4i = {1, 2, 3, 4};
93
94float f1;
95float f1i = 3.141592265358979f;
96float2 f2;
97float2 f2i = {1.f, 2.f};
98float3 f3;
99float3 f3i = {1.f, 2.f, 3.f};
100float4 f4;
101float4 f4i = {1.f, 2.f, 3.f, 4.f};
102
103double d1;
104double d1i = 3.141592265358979;
105double2 d2;
106double2 d2i = {1, 2};
107double3 d3;
108double3 d3i = {1, 2, 3};
109double4 d4;
110double4 d4i = {1, 2, 3, 4};
111
112
113void __attribute__((kernel)) test_BOOLEAN(bool in) {
114}
115
116void __attribute__((kernel)) test_I8(char in) {
117}
118
119void __attribute__((kernel)) test_U8(uchar in) {
120}
121
122void __attribute__((kernel)) test_I16(short in) {
123}
124
125void __attribute__((kernel)) test_U16(ushort in) {
126}
127
128void __attribute__((kernel)) test_I32(int in) {
129}
130
131void __attribute__((kernel)) test_U32(uint in) {
132}
133
134void __attribute__((kernel)) test_I64(long in) {
135}
136
137void __attribute__((kernel)) test_U64(ulong in) {
138}
139
140void __attribute__((kernel)) test_F32(float in) {
141}
142
143void __attribute__((kernel)) test_F64(double in) {
144}
145
146