|
@@ -89,10 +89,10 @@ void init_bucketsort(int listsize)
|
|
|
cl_platform_id platformID[num];
|
|
|
clGetPlatformIDs(num, platformID, NULL);
|
|
|
|
|
|
- clGetDeviceIDs(platformID[1],CL_DEVICE_TYPE_GPU,0,NULL,&num);
|
|
|
+ clGetDeviceIDs(platformID[1],CL_DEVICE_TYPE_CPU,0,NULL,&num);
|
|
|
|
|
|
cl_device_id devices[num];
|
|
|
- err = clGetDeviceIDs(platformID[1],CL_DEVICE_TYPE_GPU,num,devices,NULL);
|
|
|
+ err = clGetDeviceIDs(platformID[1],CL_DEVICE_TYPE_CPU,num,devices,NULL);
|
|
|
// int gpu = 1;
|
|
|
// err = clGetDeviceIDs(NULL, gpu ? CL_DEVICE_TYPE_GPU : CL_DEVICE_TYPE_CPU, 2, &device_id, NULL);
|
|
|
|
|
@@ -199,15 +199,16 @@ void histogramInit(int listsize) {
|
|
|
cl_platform_id platformID[num];
|
|
|
clGetPlatformIDs(num, platformID, NULL);
|
|
|
|
|
|
- clGetDeviceIDs(platformID[1],CL_DEVICE_TYPE_GPU,0,NULL,&num);
|
|
|
+ clGetDeviceIDs(platformID[1],CL_DEVICE_TYPE_CPU,0,NULL,&num);
|
|
|
|
|
|
+ num = 2;
|
|
|
char name[128];
|
|
|
|
|
|
clGetPlatformInfo(platformID[1], CL_PLATFORM_PROFILE,128,name,NULL);
|
|
|
|
|
|
|
|
|
cl_device_id devices[num];
|
|
|
- err = clGetDeviceIDs(platformID[1],CL_DEVICE_TYPE_GPU,num,devices,NULL);
|
|
|
+ err = clGetDeviceIDs(platformID[1],CL_DEVICE_TYPE_CPU,num,devices,NULL);
|
|
|
// int gpu = 1;
|
|
|
// err = clGetDeviceIDs(NULL, gpu ? CL_DEVICE_TYPE_GPU : CL_DEVICE_TYPE_CPU, 2, &device_id, NULL);
|
|
|
|
|
@@ -228,7 +229,7 @@ void histogramInit(int listsize) {
|
|
|
0
|
|
|
};
|
|
|
|
|
|
- histoContext = clCreateContext(contextProperties, 1, &devices[0], NULL, NULL, &err);
|
|
|
+ histoContext = clCreateContext(0, 1, &devices[0], NULL, NULL, &err);
|
|
|
|
|
|
histoCommands = clCreateCommandQueue(histoContext, devices[0], CL_QUEUE_PROFILING_ENABLE, &err);
|
|
|
histoInput = clCreateBuffer(histoContext, CL_MEM_READ_ONLY, listsize*(sizeof(float)), NULL, NULL);
|