summaryrefslogtreecommitdiff
path: root/tests/cl/program/execute
diff options
context:
space:
mode:
authorJan Vesely <jan.vesely@rutgers.edu>2016-08-18 15:56:49 -0400
committerJan Vesely <jan.vesely@rutgers.edu>2017-05-01 15:45:27 -0400
commita58731248a8b8a7abf6e6640337c30ee17e5fcf8 (patch)
tree35e1948ea139461486e130b0e67d6f88ee1c179e /tests/cl/program/execute
parentf045a56aa0b2505c91050ea4e452783cd8166c15 (diff)
cl: Add input dependent test for global_offset
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Diffstat (limited to 'tests/cl/program/execute')
-rw-r--r--tests/cl/program/execute/global-offset.cl18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/cl/program/execute/global-offset.cl b/tests/cl/program/execute/global-offset.cl
index c75f2b39a..da78d2b75 100644
--- a/tests/cl/program/execute/global-offset.cl
+++ b/tests/cl/program/execute/global-offset.cl
@@ -74,6 +74,16 @@ arg_out: 0 buffer int[128] 70809 70809 70810 70809 70811 70809 70812 70809 \
101009 70809 101010 70809 101011 70809 101012 70809 \
101109 70809 101110 70809 101111 70809 101112 70809
+[test]
+name: 3d, input dependent
+kernel_name: dynamic
+dimensions: 3
+global_size: 1 1 1
+local_size: 1 1 1
+global_offset: 9 8 7
+arg_in: 0 buffer int[5] 6 6 6 6 6
+arg_out: 0 buffer int[5] 0 9 8 7 0
+arg_in: 1 int 1
!*/
kernel void fill(global int* out) {
@@ -83,3 +93,11 @@ kernel void fill(global int* out) {
out[2*pos] = id;
out[2*pos+1] = offset;
}
+
+kernel void dynamic(volatile global int *out, int j) {
+ out[0] = get_global_offset(j-2);
+ out[1] = get_global_offset(j-1);
+ out[2] = get_global_offset(j);
+ out[3] = get_global_offset(j+1);
+ out[4] = get_global_offset(j+2);
+}