Browse Source

doc: update w.r.t source code (see commit #2898)

Nathalie Furmento 14 years ago
parent
commit
a73845b3b1
1 changed files with 9 additions and 1 deletions
  1. 9 1
      doc/vector_scal_opencl.texi

+ 9 - 1
doc/vector_scal_opencl.texi

@@ -28,7 +28,15 @@ void scal_opencl_func(void *buffers[], void *_args)
 
     @{
         size_t global=n;
-        size_t local=n;
+	size_t local;
+        size_t s;
+        cl_device_id device;
+
+        starpu_opencl_get_device(devid, &device);
+        err = clGetKernelWorkGroupInfo (kernel, device, CL_KERNEL_WORK_GROUP_SIZE, sizeof(local), &local, &s);
+        if (err != CL_SUCCESS) STARPU_OPENCL_REPORT_ERROR(err);
+        if (local > global) local=global;
+
         err = clEnqueueNDRangeKernel(queue, kernel, 1, NULL, &global, &local, 0, NULL, NULL);
         if (err != CL_SUCCESS) STARPU_OPENCL_REPORT_ERROR(err);
     @}