diff options
author | Tom Stellard <thomas.stellard@amd.com> | 2012-02-13 12:49:20 -0500 |
---|---|---|
committer | Tom Stellard <thomas.stellard@amd.com> | 2012-02-14 15:16:23 -0500 |
commit | 7a5333527d7751548911fe2b21fe01d6ac8ab83c (patch) | |
tree | b50429edad5a11b4809b2a9ef10a709b91283ae9 | |
parent | 8f14fcee076ed71a02aeb5f44bd18f1f6e6cb27e (diff) |
clover: handle NULL grid_offsets in clEnqueueNDRangeKernel()
-rw-r--r-- | src/gallium/state_trackers/clover/api/kernel.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/gallium/state_trackers/clover/api/kernel.cpp b/src/gallium/state_trackers/clover/api/kernel.cpp index 4a88760f5a7..e69452b82ba 100644 --- a/src/gallium/state_trackers/clover/api/kernel.cpp +++ b/src/gallium/state_trackers/clover/api/kernel.cpp @@ -136,9 +136,18 @@ clEnqueueNDRangeKernel(cl_command_queue q, cl_kernel kern, const size_t *grid_size, const size_t *block_size, cl_uint num_deps, const cl_event *deps, cl_event *ev) { + + std::vector<size_t> offsets; + + if (grid_offset) { + offsets = { grid_offset, grid_offset + dims }; + } else { + offsets = { dims, 0 }; + } + hard_event *hev = new hard_event( *q, CL_COMMAND_NDRANGE_KERNEL, { deps, deps + num_deps }, - kernel_op(q, kern, { grid_offset, grid_offset + dims }, + kernel_op(q, kern, offsets, map(std::divides<size_t>(), grid_size, grid_size + dims, block_size), { block_size, block_size + dims })); |