summaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorTom Stellard <[email protected]>2012-09-21 20:45:50 +0000
committerFrancisco Jerez <[email protected]>2012-09-24 18:35:43 +0200
commit01877a6fd003d22f17571593dc22414e3fec883d (patch)
treeaaf294be6f5755408fffcde63e573a117f766892 /src/gallium
parenta33ce665a5827c598b85bb04d94b33e6a5e41c28 (diff)
clover: Handle NULL value for clEnqueueNDRangeKernel local_work_size
[ Francisco Jerez: Slight simplification. ]
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/state_trackers/clover/api/kernel.cpp13
1 files changed, 6 insertions, 7 deletions
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<typename T, typename S>
- std::vector<T>
- opt_vector(const T *p, S n) {
+ std::vector<size_t>
+ 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<size_t> grid_offset = opt_vector(pgrid_offset, dims);
- const std::vector<size_t> grid_size = opt_vector(pgrid_size, dims);
- const std::vector<size_t> 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);