runtime: fix max group size calculation issue.
authorZhigang Gong <zhigang.gong@linux.intel.com>
Sat, 28 Jun 2014 15:25:53 +0000 (23:25 +0800)
committerZhigang Gong <zhigang.gong@intel.com>
Tue, 1 Jul 2014 02:31:10 +0000 (10:31 +0800)
commita1ebbf7d61fa357a645b28580aafa44a20d4197b
treedc28e41fbc19c5358b369f8f3aedddcaffcd1a7f
parentff4eaa52340ab666c0fb5f8b2476aaf855422a96
runtime: fix max group size calculation issue.

If the kernel doesn't use slm/barrier, there is no hard limitation
for the max group size. And if the max work group size is more than
1024, the original 64 urb entry count will not be sufficient to hold
all the curbe payload. Change the entry count to max thread count to
fix this potential issue.

I found this bug when I tried to run phoronix test suite's juliagpu
test case on my MBA.

v2:
refine the max kernel work group size calculation mechanism.
the wg_sz should not be a device's member variable, it should be
a variable derived from kernel and device's attriute at runtime.
also fix wrong configuration for IVB GT1.

v3:
Add an important max thread limitation in the GPGPU_WALKER command.
For non-Baytrail, the max thread depth * max thread height * max thread width
should less than 64 (under either simd16 or simd8), no matter whether
SLM/barrier is used. We oversighted that limitation before, thus for
a simd8 kernel which use work group size 1024 will exceed this limitation
and half of the thread will not be executed at all.

Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
Reviewed-by: "Song, Ruiling" <ruiling.song@intel.com>
src/cl_command_queue_gen7.c
src/cl_device_id.c
src/cl_device_id.h
src/cl_kernel.c
src/intel/intel_gpgpu.c