diff options
author | Yang Rong <rong.r.yang@intel.com> | 2014-11-21 13:39:10 +0800 |
---|---|---|
committer | Zhigang Gong <zhigang.gong@intel.com> | 2014-11-24 16:56:35 +0800 |
commit | 7663cf545693de3759efc9ec3dfce3940b7b9924 (patch) | |
tree | 5a5244f671c5b8ea50ad93b8ef1fb7a05f7afcb3 | |
parent | 9c18f055d6cfbf3fac298194a636ae6767e737e0 (diff) |
Change the IVB/HSW's max_work_group_size to 512, and BYT to 256.
To decide the kernel's work group size, application should get
CL_DEVICE_MAX_WORK_GROUP_SIZE first, and then get the CL_KERNEL_WORK_GROUP_SIZE
after clBuildProgram.
But some application only check the CL_DEVICE_MAX_WORK_GROUP_SIZE, and if kernel run
simd8 mode or other cause, may exceed the CL_KERNEL_WORK_GROUP_SIZE.
So change to CL_DEVICE_MAX_WORK_GROUP_SIZE to the minimum CL_KERNEL_WORK_GROUP_SIZE.
Signed-off-by: Yang Rong <rong.r.yang@intel.com>
Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
-rw-r--r-- | src/cl_device_id.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/src/cl_device_id.c b/src/cl_device_id.c index 522c3c56..5ef0bdea 100644 --- a/src/cl_device_id.c +++ b/src/cl_device_id.c @@ -42,8 +42,8 @@ static struct _cl_device_id intel_ivb_gt2_device = { .max_compute_unit = 16, .max_thread_per_unit = 8, .sub_slice_count = 2, - .max_work_item_sizes = {1024, 1024, 1024}, - .max_work_group_size = 1024, + .max_work_item_sizes = {512, 512, 512}, + .max_work_group_size = 512, .max_clock_frequency = 1000, #include "cl_gen7_device.h" }; @@ -64,8 +64,8 @@ static struct _cl_device_id intel_baytrail_t_device = { .max_compute_unit = 4, .max_thread_per_unit = 8, .sub_slice_count = 1, - .max_work_item_sizes = {512, 512, 512}, - .max_work_group_size = 512, + .max_work_item_sizes = {256, 256, 256}, + .max_work_group_size = 256, .max_clock_frequency = 1000, #include "cl_gen7_device.h" }; @@ -76,8 +76,8 @@ static struct _cl_device_id intel_hsw_gt1_device = { .max_compute_unit = 10, .max_thread_per_unit = 7, .sub_slice_count = 1, - .max_work_item_sizes = {1024, 1024, 1024}, - .max_work_group_size = 1024, + .max_work_item_sizes = {512, 512, 512}, + .max_work_group_size = 512, .max_clock_frequency = 1000, #include "cl_gen75_device.h" }; @@ -87,8 +87,8 @@ static struct _cl_device_id intel_hsw_gt2_device = { .max_compute_unit = 20, .max_thread_per_unit = 7, .sub_slice_count = 2, - .max_work_item_sizes = {1024, 1024, 1024}, - .max_work_group_size = 1024, + .max_work_item_sizes = {512, 512, 512}, + .max_work_group_size = 512, .max_clock_frequency = 1000, #include "cl_gen75_device.h" }; @@ -98,8 +98,8 @@ static struct _cl_device_id intel_hsw_gt3_device = { .max_compute_unit = 40, .max_thread_per_unit = 7, .sub_slice_count = 4, - .max_work_item_sizes = {1024, 1024, 1024}, - .max_work_group_size = 1024, + .max_work_item_sizes = {512, 512, 512}, + .max_work_group_size = 512, .max_clock_frequency = 1000, #include "cl_gen75_device.h" }; @@ -110,7 +110,7 @@ static struct _cl_device_id intel_brw_gt1_device = { .max_compute_unit = 12, .max_thread_per_unit = 7, .sub_slice_count = 2, - .max_work_item_sizes = {1024, 1024, 1024}, + .max_work_item_sizes = {512, 512, 512}, .max_work_group_size = 512, .max_clock_frequency = 1000, #include "cl_gen75_device.h" @@ -121,7 +121,7 @@ static struct _cl_device_id intel_brw_gt2_device = { .max_compute_unit = 24, .max_thread_per_unit = 7, .sub_slice_count = 3, - .max_work_item_sizes = {1024, 1024, 1024}, + .max_work_item_sizes = {512, 512, 512}, .max_work_group_size = 512, .max_clock_frequency = 1000, #include "cl_gen75_device.h" @@ -132,7 +132,7 @@ static struct _cl_device_id intel_brw_gt3_device = { .max_compute_unit = 48, .max_thread_per_unit = 7, .sub_slice_count = 6, - .max_work_item_sizes = {1024, 1024, 1024}, + .max_work_item_sizes = {512, 512, 512}, .max_work_group_size = 512, .max_clock_frequency = 1000, #include "cl_gen75_device.h" @@ -669,9 +669,9 @@ cl_get_kernel_max_wg_sz(cl_kernel kernel) if(thread_cnt > 64) thread_cnt = 64; work_group_size = thread_cnt * simd_width; - if(work_group_size > kernel->program->ctx->device->max_work_group_size) - work_group_size = kernel->program->ctx->device->max_work_group_size; } + if(work_group_size > kernel->program->ctx->device->max_work_group_size) + work_group_size = kernel->program->ctx->device->max_work_group_size; return work_group_size; } |