clover: Pass work_dim parameter of clEnqueueNDRangeKernel() to driver
authorHans de Goede <hdegoede@redhat.com>
Fri, 22 Apr 2016 12:47:05 +0000 (14:47 +0200)
committerHans de Goede <hdegoede@redhat.com>
Sat, 2 Jul 2016 10:21:28 +0000 (12:21 +0200)
In order to implement get_work_dim() the driver may need to know the
clEnqueueNDRangeKernel() work_dim parameter, so pass it to the driver.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
src/gallium/include/pipe/p_state.h
src/gallium/state_trackers/clover/core/kernel.cpp

index 5526c392aa706fcb7f064d88b061fc8b160663a9..f4bee38a1957980c511fbd75e4188b75b2f9943a 100644 (file)
@@ -755,6 +755,13 @@ struct pipe_grid_info
     */
    void *input;
 
+   /**
+    * Grid number of dimensions, 1-3, e.g. the work_dim parameter passed to
+    * clEnqueueNDRangeKernel. Note block[] and grid[] must be padded with
+    * 1 for non-used dimensions.
+    */
+   uint work_dim;
+
    /**
     * Determine the layout of the working block (in thread units) to be used.
     */
index 9231462b8226408c23de822fa9d2e9a04d7c8588..d9bda6c712c4805cc503dae24e2bc05e56577f52 100644 (file)
@@ -76,6 +76,7 @@ kernel::launch(command_queue &q,
                               exec.g_buffers.data(), g_handles.data());
 
    // Fill information for the launch_grid() call.
+   info.work_dim = grid_size.size();
    copy(pad_vector(q, block_size, 1), info.block);
    copy(pad_vector(q, reduced_grid_size, 1), info.grid);
    info.pc = find(name_equals(_name), m.syms).offset;