summaryrefslogtreecommitdiff
path: root/backend/kernels/loop2.cl
diff options
context:
space:
mode:
authorBenjamin Segovia <segovia.benjamin@gmail.com>2012-03-16 19:38:57 +0000
committerKeith Packard <keithp@keithp.com>2012-08-10 16:15:43 -0700
commit2e17010ba5c592cc95e215461a8bcbd3d6151c30 (patch)
tree8216559f15e263c9548dc74402d36bf71a70be2d /backend/kernels/loop2.cl
parent6f7b95e50bed046c9533dbe81483f853bbbf0b8c (diff)
downloadbeignet-2e17010ba5c592cc95e215461a8bcbd3d6151c30.tar.gz
Started to fix problem with blocks that do not end with BRA instructions
Diffstat (limited to 'backend/kernels/loop2.cl')
-rw-r--r--backend/kernels/loop2.cl14
1 files changed, 14 insertions, 0 deletions
diff --git a/backend/kernels/loop2.cl b/backend/kernels/loop2.cl
new file mode 100644
index 00000000..04997aeb
--- /dev/null
+++ b/backend/kernels/loop2.cl
@@ -0,0 +1,14 @@
+#include "stdlib.h"
+
+struct big { int x[10]; };
+
+__kernel void add(__global int *dst, unsigned int x, struct big b)
+{
+ for (int i = 0; i < x; ++i) {
+ if (dst[i+1] > 0)
+ dst[i]++;
+ else
+ dst[i] += 2;
+ }
+}
+