Commit 0edfa5d2 authored by Bernd Machenschalk's avatar Bernd Machenschalk

Merge branch 'remove-GPU-constraint' into 'master'

Remove GPU constraint

See merge request einsteinathome/libclfft!4
parents 137b4784 8d760160
......@@ -719,7 +719,7 @@ cl_device_type getGlobalDeviceType()
return CL_DEVICE_TYPE_DEFAULT;
}
// default
return CL_DEVICE_TYPE_GPU;
return CL_DEVICE_TYPE_ALL;
}
void
......@@ -762,12 +762,6 @@ int main (int argc, char * const argv[]) {
unsigned int num_devices;
cl_device_type device_type = getGlobalDeviceType();
if(device_type != CL_DEVICE_TYPE_GPU)
{
log_info("Test only supported on DEVICE_TYPE_GPU\n");
test_finish();
exit(0);
}
cl_uint numPlatforms;
cl_platform_id platform = NULL;
......
......@@ -364,7 +364,6 @@ clFFT_CreatePlanAdv( cl_context context, clFFT_Dim3 n, clFFT_Dimension dim, clFF
cl_fft_plan *plan = NULL;
ostringstream kString;
int num_devices;
int gpu_found = 0;
cl_device_id devices[16];
size_t ret_size;
cl_device_type device_type;
......@@ -435,39 +434,32 @@ patch_kernel_source:
err = clGetDeviceInfo(devices[i], CL_DEVICE_TYPE, sizeof(device_type), &device_type, NULL);
ERR_MACRO(err);
if(device_type == CL_DEVICE_TYPE_GPU)
err = clBuildProgram(plan->program, 1, &devices[i], "-cl-mad-enable -cl-single-precision-constant", NULL, NULL);
if (err != CL_SUCCESS)
{
gpu_found = 1;
err = clBuildProgram(plan->program, 1, &devices[i], "-cl-mad-enable -cl-single-precision-constant", NULL, NULL);
if (err != CL_SUCCESS)
{
char *build_log;
char devicename[200];
size_t log_size;
char *build_log;
char devicename[200];
size_t log_size;
err = clGetProgramBuildInfo(plan->program, devices[i], CL_PROGRAM_BUILD_LOG, 0, NULL, &log_size);
ERR_MACRO(err);
err = clGetProgramBuildInfo(plan->program, devices[i], CL_PROGRAM_BUILD_LOG, 0, NULL, &log_size);
ERR_MACRO(err);
build_log = (char *) malloc(log_size + 1);
build_log = (char *) malloc(log_size + 1);
err = clGetProgramBuildInfo(plan->program, devices[i], CL_PROGRAM_BUILD_LOG, log_size, build_log, NULL);
ERR_MACRO(err);
err = clGetProgramBuildInfo(plan->program, devices[i], CL_PROGRAM_BUILD_LOG, log_size, build_log, NULL);
ERR_MACRO(err);
err = clGetDeviceInfo(devices[i], CL_DEVICE_NAME, sizeof(devicename), devicename, NULL);
ERR_MACRO(err);
err = clGetDeviceInfo(devices[i], CL_DEVICE_NAME, sizeof(devicename), devicename, NULL);
ERR_MACRO(err);
fprintf(stdout, "FFT program build log on device %s\n", devicename);
fprintf(stdout, "%s\n", build_log);
free(build_log);
fprintf(stdout, "FFT program build log on device %s\n", devicename);
fprintf(stdout, "%s\n", build_log);
free(build_log);
ERR_MACRO(err);
}
ERR_MACRO(err);
}
}
if(!gpu_found)
ERR_MACRO(CL_INVALID_CONTEXT);
err = createKernelList(plan);
ERR_MACRO(err);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment