.max_work_item_sizes = {512, 512, 512},
.max_work_group_size = 512,
.max_clock_frequency = 1350,
-
+ /* Does not really belong here, but for now this seems the most
+ * natural place to put it */
+ .wg_sz = 512,
+ .compile_wg_sz = {0},
#include "cl_gen6_device.h"
};
.max_work_item_sizes = {256, 256, 256},
.max_work_group_size = 256,
.max_clock_frequency = 1000,
+ .wg_sz = 256,
+ .compile_wg_sz = {0},
#include "cl_gen6_device.h"
};
.max_work_group_size = 512,
.max_clock_frequency = 1000,
+ .wg_sz = 1024,
+ .compile_wg_sz = {0},
#include "cl_gen7_device.h"
};
.max_work_item_sizes = {512, 512, 512},
.max_work_group_size = 512,
.max_clock_frequency = 1000,
+ .wg_sz = 512,
+ .compile_wg_sz = {0},
#include "cl_gen7_device.h"
};
*ver = 7;
return CL_SUCCESS;
}
+#undef DECL_FIELD
+#define DECL_FIELD(CASE,FIELD) \
+ case JOIN(CL_KERNEL_,CASE): \
+ if (param_value_size < sizeof(((cl_device_id)NULL)->FIELD)) \
+ return CL_INVALID_VALUE; \
+ if (param_value_size_ret != NULL) \
+ *param_value_size_ret = sizeof(((cl_device_id)NULL)->FIELD);\
+ memcpy(param_value, \
+ &device->FIELD, \
+ sizeof(((cl_device_id)NULL)->FIELD)); \
+ return CL_SUCCESS;
+LOCAL cl_int cl_get_kernel_workgroup_info(
+ cl_device_id device,
+ cl_kernel_work_group_info param_name,
+ size_t param_value_size,
+ void* param_value,
+ size_t* param_value_size_ret)
+{
+ if (UNLIKELY(device != &intel_snb_gt1_device &&
+ device != &intel_snb_gt2_device &&
+ device != &intel_ivb_gt1_device &&
+ device != &intel_ivb_gt2_device))
+ return CL_INVALID_DEVICE;
+ if (UNLIKELY(param_value == NULL))
+ return CL_INVALID_VALUE;
+
+ switch (param_name) {
+ DECL_FIELD(WORK_GROUP_SIZE, wg_sz)
+ DECL_FIELD(COMPILE_WORK_GROUP_SIZE, compile_wg_sz)
+ default: return CL_INVALID_VALUE;
+ };
+
+
+}
size_t profile_sz;
size_t opencl_c_version_sz;
size_t extensions_sz;
+ /* Kernel specific info that we're assigning statically */
+ size_t wg_sz;
+ size_t compile_wg_sz[3];
uint32_t gfx_id; /* Used by shaders */
};
void * param_value,
size_t * param_value_size_ret);
+extern cl_int cl_get_kernel_workgroup_info(cl_device_id device,
+ cl_kernel_work_group_info param_name,
+ size_t param_value_size,
+ void * param_value,
+ 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);
err = CL_MEM_ALLOCATION_FAILURE;
goto error;
}
-
/* Copy the data if required */
if (flags & CL_MEM_COPY_HOST_PTR) /* TODO check other flags too */
+ drm_intel_bo_subdata(mem->bo, 0, sz, data);
+ #if 0
if (UNLIKELY(drm_intel_bo_subdata(mem->bo, 0, sz, data) != 0)) {
err = CL_MEM_ALLOCATION_FAILURE;
goto error;
}
+ #endif
+
/* Append the buffer in the context buffer list */
pthread_mutex_lock(&ctx->buffer_lock);