myfree (tmp);
}
- if (data.vendor_id == VENDOR_ID_POCL)
- {
- // NOTE: clEnqueueFillBuffer () segfaults with Ubuntu 15.04 pocl
- // We need to workaround...
-
- #define FILLSZ 0x100000
-
- char *tmp = (char *) mymalloc (FILLSZ);
-
- memset (tmp, 0, FILLSZ);
-
- for (uint i = 0; i < size; i += FILLSZ)
- {
- const int left = size - i;
-
- const int fillsz = MIN (FILLSZ, left);
-
- hc_clEnqueueWriteBuffer (device_param->command_queue, buf, CL_TRUE, i, fillsz, tmp, 0, NULL, NULL);
- }
-
- myfree (tmp);
- }
-
- if (data.vendor_id == VENDOR_ID_UNKNOWN)
+ if (data.vendor_id == VENDOR_ID_GENERIC)
{
const cl_uchar zero = 0;
return (-1);
}
- uint CL_platform_sel = 1;
+ int CL_platform_sel = 1;
if (opencl_platform != NULL)
{
return (-1);
}
- if (CL_platform_sel > CL_platforms_cnt)
+ if (CL_platform_sel > (int) CL_platforms_cnt)
{
log_error ("ERROR: invalid OpenCL platforms selected");
hc_clGetPlatformInfo (CL_platform, CL_PLATFORM_VENDOR, sizeof (CL_platform_vendor), CL_platform_vendor, NULL);
- cl_device_type device_type;
+ cl_device_type device_type_filter;
uint vendor_id;
{
vendor_id = VENDOR_ID_AMD;
- device_type = CL_DEVICE_TYPE_GPU;
+ device_type_filter = CL_DEVICE_TYPE_GPU;
}
else if (strcmp (CL_platform_vendor, CL_VENDOR_NV) == 0)
{
vendor_id = VENDOR_ID_NV;
- device_type = CL_DEVICE_TYPE_GPU;
+ device_type_filter = CL_DEVICE_TYPE_GPU;
// make sure that we do not directly control the fan for NVidia
}
else if (strcmp (CL_platform_vendor, CL_VENDOR_POCL) == 0)
{
- vendor_id = VENDOR_ID_POCL;
+ if (force == 0)
+ {
+ log_error ("");
+ log_error ("ATTENTION! All pocl drivers are known to be broken due to broken LLVM <= 3.7");
+ log_error ("You are STRONGLY encouraged not to use it");
+ log_error ("You can use --force to override this but do not post error reports if you do so");
+
+ return (-1);
+ }
- device_type = CL_DEVICE_TYPE_CPU;
+ vendor_id = VENDOR_ID_GENERIC;
- gpu_temp_disable = 1;
+ device_type_filter = CL_DEVICE_TYPE_DEFAULT;
}
else
{
- vendor_id = VENDOR_ID_UNKNOWN;
+ vendor_id = VENDOR_ID_GENERIC;
- device_type = CL_DEVICE_TYPE_DEFAULT;
+ device_type_filter = CL_DEVICE_TYPE_DEFAULT;
}
- if (vendor_id == VENDOR_ID_UNKNOWN)
+ if (vendor_id == VENDOR_ID_GENERIC)
{
log_error ("Warning: unknown OpenCL vendor '%s' detected", CL_platform_vendor);
uint devices_all_cnt = 0;
- hc_clGetDeviceIDs (CL_platform, device_type, DEVICES_MAX, devices_all, (uint *) &devices_all_cnt);
+ hc_clGetDeviceIDs (CL_platform, device_type_filter, DEVICES_MAX, devices_all, (uint *) &devices_all_cnt);
int hm_adapters_all = devices_all_cnt;
device_param->device_name_chksum = mystrdup (tmp);
- if (device_type == CL_DEVICE_TYPE_CPU)
+ if (device_type & CL_DEVICE_TYPE_CPU)
{
cl_uint device_processor_cores = 1;
device_param->device_processor_cores = device_processor_cores;
}
- if (device_type == CL_DEVICE_TYPE_GPU)
+ if (device_type & CL_DEVICE_TYPE_GPU)
{
if (vendor_id == VENDOR_ID_AMD)
{
* common driver check
*/
- if (device_type == CL_DEVICE_TYPE_GPU)
+ if (device_type & CL_DEVICE_TYPE_GPU)
{
if (vendor_id == VENDOR_ID_NV)
{
uint device_processor_cores = device_param->device_processor_cores;
+ cl_device_type device_type = device_param->device_type;
+
/**
* create context for each device
*/
if (hash_mode == 3200) kernel_threads = 8;
if (hash_mode == 9000) kernel_threads = 8;
- if (device_type == CL_DEVICE_TYPE_CPU)
+ if (device_type & CL_DEVICE_TYPE_CPU)
{
// CPU still need lots of workitems, don't know why...
+ // for testing phase, lets start with this
- kernel_accel = (kernel_accel >= 8) ? kernel_accel / 8 : 1;
+ kernel_accel = 1;
}
uint kernel_power = device_processors * kernel_threads * kernel_accel;