I'm using the Nvidia implementation of openCL.
cl_uint devicecount=NULL;
cl_uint NumPlatforms;
clGetPlatformIDs (0, NULL, &NumPlatforms);
cl_platform_id* PlatformIDs;
PlatformIDs = new cl_platform_id[NumPlatforms];
clGetPlatformIDs(NumPlatforms, PlatformIDs, NULL);
cl_device_id cdDevice;
clGetDeviceIDs(NULL, CL_DEVICE_TYPE_CPU, 1, &cdDevice, &devicecount);
cout << NumPlatforms << endl;
cout << PlatformIDs << endl;
cout << cdDevice << endl;
cout << devicecount << endl;
I actually probably don't have a compatible GPU at the moment, but I have a compatible CPU. The query tells me that I have 0 platforms, and 0 devices. Am I doing this correctly? I don't exactly understand what a platform is, and why I don't have one. What exactly does it take for openCL to find and use a platform?
EDIT:
I got my new card in the mail today, installed amd sdk, and reinstalled nvidia sdk, and I am now seeing all my platforms and devices!
The next step is to create contexts. Can I put devices from different platforms on the same context? Is it very difficult, given you need separate command queues for each device etc, to write a program to use all devices on a system even if the number is a hundred thousand?