diff options
author | Yang Rong <rong.r.yang@intel.com> | 2015-05-11 14:02:54 +0800 |
---|---|---|
committer | Zhigang Gong <zhigang.gong@intel.com> | 2015-05-15 10:41:29 +0800 |
commit | 9ff560d00932eb3e97b9fece016704ad81ac3041 (patch) | |
tree | 453498c0cac976b2418107631ebc83b53325b74c /kernels | |
parent | f6bbef6404a6026fe774a07989f30a5c3578793e (diff) |
Add stuct argument indirect load test.
1. Enable compiler_argument_structure_indirect.
2. Add compiler_argument_structure_indirect, which has select address and load argument instruction.
Signed-off-by: Yang Rong <rong.r.yang@intel.com>
Reviewed-by: Zhigang Gong <zhigang.gong@intel.com>
Diffstat (limited to 'kernels')
-rw-r--r-- | kernels/compiler_argument_structure_indirect.cl | 4 | ||||
-rw-r--r-- | kernels/compiler_argument_structure_select.cl | 18 |
2 files changed, 20 insertions, 2 deletions
diff --git a/kernels/compiler_argument_structure_indirect.cl b/kernels/compiler_argument_structure_indirect.cl index c4b062f9..6fd7873d 100644 --- a/kernels/compiler_argument_structure_indirect.cl +++ b/kernels/compiler_argument_structure_indirect.cl @@ -1,7 +1,7 @@ -struct hop { int x[16]; }; +struct hop { int a, x[16]; }; __kernel void -compiler_argument_structure(__global int *dst, struct hop h) +compiler_argument_structure_indirect(__global int *dst, struct hop h) { int id = (int)get_global_id(0); dst[id] = h.x[get_local_id(0)]; diff --git a/kernels/compiler_argument_structure_select.cl b/kernels/compiler_argument_structure_select.cl new file mode 100644 index 00000000..295acf48 --- /dev/null +++ b/kernels/compiler_argument_structure_select.cl @@ -0,0 +1,18 @@ +typedef struct { + int offset; + int threshold0; + int threshold1; +}hop; + +__kernel void compiler_argument_structure_select(__global int *dst, hop h) +{ + int i = get_global_id (0); + int threshold=0; + if (i == 0) { + threshold = h.threshold0; + } else { + threshold = h.threshold1; + } + dst[i] = threshold; +} + |