INIT_ICD(dispatch)
.max_compute_unit = 16,
.max_thread_per_unit = 8,
- .max_work_item_sizes = {512, 512, 512},
+ .max_work_item_sizes = {1024, 1024, 1024},
.max_work_group_size = 1024,
.max_clock_frequency = 1000,
- .wg_sz = 1024,
#include "cl_gen7_device.h"
};
static struct _cl_device_id intel_ivb_gt1_device = {
INIT_ICD(dispatch)
- .max_compute_unit = 8,
- .max_thread_per_unit = 8,
+ .max_compute_unit = 6,
+ .max_thread_per_unit = 6,
.max_work_item_sizes = {512, 512, 512},
.max_work_group_size = 512,
.max_clock_frequency = 1000,
- .wg_sz = 512,
#include "cl_gen7_device.h"
};
.max_compute_unit = 4,
.max_thread_per_unit = 8,
.max_work_item_sizes = {512, 512, 512},
- .max_work_group_size = 256,
+ .max_work_group_size = 512,
.max_clock_frequency = 1000,
- .wg_sz = 256,
#include "cl_gen7_device.h"
};
INIT_ICD(dispatch)
.max_compute_unit = 10,
.max_thread_per_unit = 7,
- .max_work_item_sizes = {512, 512, 512},
- .max_work_group_size = 512,
+ .max_work_item_sizes = {1024, 1024, 1024},
+ .max_work_group_size = 1024,
.max_clock_frequency = 1000,
- .wg_sz = 512,
#include "cl_gen75_device.h"
};
INIT_ICD(dispatch)
.max_compute_unit = 20,
.max_thread_per_unit = 7,
- .max_work_item_sizes = {512, 512, 512},
+ .max_work_item_sizes = {1024, 1024, 1024},
.max_work_group_size = 1024,
.max_clock_frequency = 1000,
- .wg_sz = 1024,
#include "cl_gen75_device.h"
};
INIT_ICD(dispatch)
.max_compute_unit = 40,
.max_thread_per_unit = 7,
- .max_work_item_sizes = {512, 512, 512},
+ .max_work_item_sizes = {1024, 1024, 1024},
.max_work_group_size = 1024,
.max_clock_frequency = 1000,
- .wg_sz = 2048,
#include "cl_gen75_device.h"
};
_DECL_FIELD(FIELD)
#include "cl_kernel.h"
+#include "cl_program.h"
+
+LOCAL size_t
+cl_get_kernel_max_wg_sz(cl_kernel kernel)
+{
+ size_t work_group_size;
+ int simd_width = interp_kernel_get_simd_width(kernel->opaque);
+ int vendor_id = kernel->program->ctx->device->vendor_id;
+ if (!interp_kernel_use_slm(kernel->opaque)) {
+ if (!IS_BAYTRAIL_T(vendor_id) || simd_width == 16)
+ work_group_size = simd_width * 64;
+ else
+ work_group_size = kernel->program->ctx->device->max_compute_unit *
+ kernel->program->ctx->device->max_thread_per_unit * simd_width;
+ } else
+ work_group_size = kernel->program->ctx->device->max_work_group_size /
+ (16 / simd_width);
+ return work_group_size;
+}
+
LOCAL cl_int
cl_get_kernel_workgroup_info(cl_kernel kernel,
cl_device_id device,
CHECK_KERNEL(kernel);
switch (param_name) {
- DECL_FIELD(WORK_GROUP_SIZE, device->wg_sz)
+ case CL_KERNEL_WORK_GROUP_SIZE:
+ {
+ if (param_value && param_value_size < sizeof(size_t))
+ return CL_INVALID_VALUE;
+ if (param_value_size_ret != NULL)
+ *param_value_size_ret = sizeof(size_t);
+ if (param_value) {
+ size_t work_group_size = cl_get_kernel_max_wg_sz(kernel);
+ *(size_t*)param_value = work_group_size;
+ return CL_SUCCESS;
+ }
+ }
DECL_FIELD(PREFERRED_WORK_GROUP_SIZE_MULTIPLE, device->preferred_wg_sz_mul)
case CL_KERNEL_LOCAL_MEM_SIZE:
- {
- size_t local_mem_sz = interp_kernel_get_slm_size(kernel->opaque) + kernel->local_mem_sz;
- _DECL_FIELD(local_mem_sz)
- }
+ {
+ size_t local_mem_sz = interp_kernel_get_slm_size(kernel->opaque) + kernel->local_mem_sz;
+ _DECL_FIELD(local_mem_sz)
+ }
DECL_FIELD(COMPILE_WORK_GROUP_SIZE, kernel->compile_wg_sz)
DECL_FIELD(PRIVATE_MEM_SIZE, kernel->stack_size)
default:
DEFINE_ICD(dispatch)
cl_device_type device_type;
cl_uint vendor_id;
- cl_uint max_compute_unit;
- cl_uint max_thread_per_unit;
- cl_uint max_work_item_dimensions;
- size_t max_work_item_sizes[3];
- size_t max_work_group_size;
+ cl_uint max_compute_unit; // maximum EU number
+ cl_uint max_thread_per_unit; // maximum EU threads per EU.
+ cl_uint max_work_item_dimensions; // should be 3.
+ size_t max_work_item_sizes[3]; // equal to maximum work group size.
+ size_t max_work_group_size; // maximum work group size under simd16 mode.
cl_uint preferred_vector_width_char;
cl_uint preferred_vector_width_short;
cl_uint preferred_vector_width_int;
size_t driver_version_sz;
size_t built_in_kernels_sz;
/* Kernel specific info that we're assigning statically */
- size_t wg_sz;
size_t preferred_wg_sz_mul;
/* SubDevice specific info */
cl_device_id parent_device;
size_t * param_value_size_ret);
/* Returns the Gen device ID */
extern cl_int cl_device_get_version(cl_device_id device, cl_int *ver);
+extern size_t cl_get_kernel_max_wg_sz(cl_kernel);
#endif /* __CL_DEVICE_ID_H__ */