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:
17
src/main.cpp
17
src/main.cpp
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user