aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.opencl/operators.cl
diff options
context:
space:
mode:
authorKen Werner <ken.werner@de.ibm.com>2011-01-25 16:10:28 +0000
committerKen Werner <ken.werner@de.ibm.com>2011-01-25 16:10:28 +0000
commitd468832aa56d114691596968939b3026cf0519b5 (patch)
tree50837ea973f12d08e7bfc78264c69b56f4f38c63 /gdb/testsuite/gdb.opencl/operators.cl
parent29ec52635125c2e188b04e0319f6e27493fbd933 (diff)
downloadfsf-binutils-gdb-d468832aa56d114691596968939b3026cf0519b5.zip
fsf-binutils-gdb-d468832aa56d114691596968939b3026cf0519b5.tar.gz
fsf-binutils-gdb-d468832aa56d114691596968939b3026cf0519b5.tar.bz2
gdb/testsuite/ChangeLog
2011-01-25 Ken Werner <ken.werner@de.ibm.com> * gdb.opencl/convs_casts.cl: Move program scope variables into the OpenCL kernel function. Add a comment as marker. Add address space qualifiers for the remaining program scope variables. * gdb.opencl/datatypes.cl: Likewise. * gdb.opencl/operators.cl: Likewise. * gdb.opencl/vec_comps.cl: Likewise. * gdb.opencl/convs_casts.exp: Replace gdb_test_multiple by gdb_test. Add breakpoint at the marker comment. * gdb.opencl/datatypes.exp: Likewise. * gdb.opencl/operators.exp: Likewise. * gdb.opencl/vec_comps.exp: Likewise.
Diffstat (limited to 'gdb/testsuite/gdb.opencl/operators.cl')
-rw-r--r--gdb/testsuite/gdb.opencl/operators.cl122
1 files changed, 62 insertions, 60 deletions
diff --git a/gdb/testsuite/gdb.opencl/operators.cl b/gdb/testsuite/gdb.opencl/operators.cl
index 2f12772..fd5110e 100644
--- a/gdb/testsuite/gdb.opencl/operators.cl
+++ b/gdb/testsuite/gdb.opencl/operators.cl
@@ -17,89 +17,91 @@
Contributed by Ken Werner <ken.werner@de.ibm.com> */
-int opencl_version = __OPENCL_VERSION__;
+__constant int opencl_version = __OPENCL_VERSION__;
#ifdef HAVE_cl_khr_fp64
#pragma OPENCL EXTENSION cl_khr_fp64 : enable
-int have_cl_khr_fp64 = 1;
+__constant int have_cl_khr_fp64 = 1;
#else
-int have_cl_khr_fp64 = 0;
+__constant int have_cl_khr_fp64 = 0;
#endif
#ifdef HAVE_cl_khr_fp16
#pragma OPENCL EXTENSION cl_khr_fp16 : enable
-int have_cl_khr_fp16 = 1;
+__constant int have_cl_khr_fp16 = 1;
#else
-int have_cl_khr_fp16 = 0;
+__constant int have_cl_khr_fp16 = 0;
#endif
-char ca = 2;
-char cb = 1;
-uchar uca = 2;
-uchar ucb = 1;
-char4 c4a = (char4) (2, 4, 8, 16);
-char4 c4b = (char4) (1, 2, 8, 4);
-uchar4 uc4a = (uchar4) (2, 4, 8, 16);
-uchar4 uc4b = (uchar4) (1, 2, 8, 4);
-
-short sa = 2;
-short sb = 1;
-ushort usa = 2;
-ushort usb = 1;
-short4 s4a = (short4) (2, 4, 8, 16);
-short4 s4b = (short4) (1, 2, 8, 4);
-ushort4 us4a = (ushort4) (2, 4, 8, 16);
-ushort4 us4b = (ushort4) (1, 2, 8, 4);
-
-int ia = 2;
-int ib = 1;
-uint uia = 2;
-uint uib = 1;
-int4 i4a = (int4) (2, 4, 8, 16);
-int4 i4b = (int4) (1, 2, 8, 4);
-uint4 ui4a = (uint4) (2, 4, 8, 16);
-uint4 ui4b = (uint4) (1, 2, 8, 4);
-
-long la = 2;
-long lb = 1;
-ulong ula = 2;
-ulong ulb = 1;
-long4 l4a = (long4) (2, 4, 8, 16);
-long4 l4b = (long4) (1, 2, 8, 4);
-ulong4 ul4a = (ulong4) (2, 4, 8, 16);
-ulong4 ul4b = (ulong4) (1, 2, 8, 4);
+__kernel void testkernel (__global int *data)
+{
+ char ca = 2;
+ char cb = 1;
+ uchar uca = 2;
+ uchar ucb = 1;
+ char4 c4a = (char4) (2, 4, 8, 16);
+ char4 c4b = (char4) (1, 2, 8, 4);
+ uchar4 uc4a = (uchar4) (2, 4, 8, 16);
+ uchar4 uc4b = (uchar4) (1, 2, 8, 4);
+
+ short sa = 2;
+ short sb = 1;
+ ushort usa = 2;
+ ushort usb = 1;
+ short4 s4a = (short4) (2, 4, 8, 16);
+ short4 s4b = (short4) (1, 2, 8, 4);
+ ushort4 us4a = (ushort4) (2, 4, 8, 16);
+ ushort4 us4b = (ushort4) (1, 2, 8, 4);
+
+ int ia = 2;
+ int ib = 1;
+ uint uia = 2;
+ uint uib = 1;
+ int4 i4a = (int4) (2, 4, 8, 16);
+ int4 i4b = (int4) (1, 2, 8, 4);
+ uint4 ui4a = (uint4) (2, 4, 8, 16);
+ uint4 ui4b = (uint4) (1, 2, 8, 4);
+
+ long la = 2;
+ long lb = 1;
+ ulong ula = 2;
+ ulong ulb = 1;
+ long4 l4a = (long4) (2, 4, 8, 16);
+ long4 l4b = (long4) (1, 2, 8, 4);
+ ulong4 ul4a = (ulong4) (2, 4, 8, 16);
+ ulong4 ul4b = (ulong4) (1, 2, 8, 4);
#ifdef cl_khr_fp16
-half ha = 2;
-half hb = 1;
-half4 h4a = (half4) (2, 4, 8, 16);
-half4 h4b = (half4) (1, 2, 8, 4);
+ half ha = 2;
+ half hb = 1;
+ half4 h4a = (half4) (2, 4, 8, 16);
+ half4 h4b = (half4) (1, 2, 8, 4);
#endif
-float fa = 2;
-float fb = 1;
-float4 f4a = (float4) (2, 4, 8, 16);
-float4 f4b = (float4) (1, 2, 8, 4);
+ float fa = 2;
+ float fb = 1;
+ float4 f4a = (float4) (2, 4, 8, 16);
+ float4 f4b = (float4) (1, 2, 8, 4);
#ifdef cl_khr_fp64
-double da = 2;
-double db = 1;
-double4 d4a = (double4) (2, 4, 8, 16);
-double4 d4b = (double4) (1, 2, 8, 4);
+ double da = 2;
+ double db = 1;
+ double4 d4a = (double4) (2, 4, 8, 16);
+ double4 d4b = (double4) (1, 2, 8, 4);
#endif
-uint4 ui4 = (uint4) (2, 4, 8, 16);
-int2 i2 = (int2) (1, 2);
-long2 l2 = (long2) (1, 2);
+ uint4 ui4 = (uint4) (2, 4, 8, 16);
+ int2 i2 = (int2) (1, 2);
+ long2 l2 = (long2) (1, 2);
#ifdef cl_khr_fp16
-half2 h2 = (half2) (1, 2);
+ half2 h2 = (half2) (1, 2);
#endif
-float2 f2 = (float2) (1, 2);
+ float2 f2 = (float2) (1, 2);
#ifdef cl_khr_fp64
-double2 d2 = (double2) (1, 2);
+ double2 d2 = (double2) (1, 2);
#endif
-__kernel void testkernel (__global int *data)
-{
+ /* marker! */
+
data[get_global_id(0)] = 1;
}