Cleaned up the cmake file. Imports SFML, CL, and GL now.

But I'm not sure how well it will work on windows so I need
to test that out. Also added a stack overflow snippet to
check your compute devices and give their opencl version
This commit is contained in:
2016-08-09 18:31:02 -07:00
parent 98be74d0f4
commit bc093ef4e4
2 changed files with 43 additions and 17 deletions

View File

@@ -15,6 +15,23 @@ const int WINDOW_Y = 150;
int main(){
cl_uint num_devices, i;
clGetDeviceIDs(NULL, CL_DEVICE_TYPE_ALL, 0, NULL, &num_devices);
cl_device_id* devices = (cl_device_id*)calloc(sizeof(cl_device_id), num_devices);
clGetDeviceIDs(NULL, CL_DEVICE_TYPE_ALL, num_devices, devices, NULL);
char buf[128];
for (i = 0; i < num_devices; i++) {
clGetDeviceInfo(devices[i], CL_DEVICE_NAME, 128, buf, NULL);
fprintf(stdout, "Device %s supports ", buf);
clGetDeviceInfo(devices[i], CL_DEVICE_VERSION, 128, buf, NULL);
fprintf(stdout, "%s\n", buf);
}
free(devices);
// Get the number of platforms
cl_uint platformIdCount = 0;
clGetPlatformIDs(0, nullptr, &platformIdCount);