From 01877a6fd003d22f17571593dc22414e3fec883d Mon Sep 17 00:00:00 2001 From: Tom Stellard Date: Fri, 21 Sep 2012 20:45:50 +0000 Subject: clover: Handle NULL value for clEnqueueNDRangeKernel local_work_size [ Francisco Jerez: Slight simplification. ] --- src/gallium/state_trackers/clover/api/kernel.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'src/gallium') diff --git a/src/gallium/state_trackers/clover/api/kernel.cpp b/src/gallium/state_trackers/clover/api/kernel.cpp index ab4982d2951..775f251e076 100644 --- a/src/gallium/state_trackers/clover/api/kernel.cpp +++ b/src/gallium/state_trackers/clover/api/kernel.cpp @@ -259,13 +259,12 @@ namespace { }; } - template - std::vector - opt_vector(const T *p, S n) { + std::vector + opt_vector(const size_t *p, unsigned n, size_t x) { if (p) return { p, p + n }; else - return { n }; + return { n, x }; } } @@ -275,9 +274,9 @@ clEnqueueNDRangeKernel(cl_command_queue q, cl_kernel kern, const size_t *pgrid_size, const size_t *pblock_size, cl_uint num_deps, const cl_event *deps, cl_event *ev) try { - const std::vector grid_offset = opt_vector(pgrid_offset, dims); - const std::vector grid_size = opt_vector(pgrid_size, dims); - const std::vector block_size = opt_vector(pblock_size, dims); + auto grid_offset = opt_vector(pgrid_offset, dims, 0); + auto grid_size = opt_vector(pgrid_size, dims, 1); + auto block_size = opt_vector(pblock_size, dims, 1); kernel_validate(q, kern, dims, pgrid_offset, pgrid_size, pblock_size, num_deps, deps, ev); -- cgit v1.2.3