diff options
author | Zhigang Gong <zhigang.gong@intel.com> | 2015-08-13 10:24:14 +0800 |
---|---|---|
committer | Yang Rong <rong.r.yang@intel.com> | 2015-09-18 15:25:10 +0800 |
commit | 2f7a511592a079f2502b22c8774d7fd8bb07dc2e (patch) | |
tree | 75761af021b6c763c4b4ebb0de4553cb04a47fdc | |
parent | 2b4c11d0459ac129197627321aa0739894547584 (diff) |
GBE: fix the broken image_1d_buffer write.
We should treat it as a 2D image as image 1d buffer may be
exceed the 1D image size restrication.
Signed-off-by: Zhigang Gong <zhigang.gong@intel.com>
Reviewed-by: "Yang, Rong R" <rong.r.yang@intel.com>
-rw-r--r-- | backend/src/libocl/src/ocl_image.cl | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/backend/src/libocl/src/ocl_image.cl b/backend/src/libocl/src/ocl_image.cl index a8dbc925..eb1a2ff9 100644 --- a/backend/src/libocl/src/ocl_image.cl +++ b/backend/src/libocl/src/ocl_image.cl @@ -387,10 +387,22 @@ DECL_IMAGE_TYPE(image2d_array_t, 3) cl_image, defaultSampler, convert_float2(effectCoord), 0); \ } +#define DECL_WRITE_IMAGE1D_BUFFER(image_type, image_data_type, suffix, coord_type) \ + OVERLOADABLE void write_image ##suffix(image_type cl_image, \ + coord_type coord, \ + image_data_type color) \ + { \ + int2 effectCoord; \ + effectCoord.s0 = coord %8192; \ + effectCoord.s1 = coord / 8192; \ + __gen_ocl_write_image ##suffix(cl_image, effectCoord, color); \ + } + + #define DECL_IMAGE_1DBuffer(int_clamping_fix, image_data_type, suffix) \ DECL_READ_IMAGE1D_BUFFER_NOSAMPLER(image1d_buffer_t, image_data_type, \ suffix, int) \ - DECL_WRITE_IMAGE(image1d_buffer_t, image_data_type, suffix, int) + DECL_WRITE_IMAGE1D_BUFFER(image1d_buffer_t, image_data_type, suffix, int) DECL_IMAGE_1DBuffer(GEN_FIX_INT_CLAMPING, int4, i) DECL_IMAGE_1DBuffer(GEN_FIX_INT_CLAMPING, uint4, ui) |