Reputation: 1470
My intend is to Benchmark the difference between CPU and GPU. The problem is, I am only able to retreive my GPUs, my CPU is not showing up.
This program produces correct output on OSX. There, the CPU as well as the GPUs are listed:
public static void displayInfo() {
for (int platformIndex = 0; platformIndex < CLPlatform.getPlatforms().size(); platformIndex++) {
CLPlatform platform = CLPlatform.getPlatforms().get(platformIndex);
System.out.println("Platform #" + platformIndex + ":" + platform.getInfoString(CL_PLATFORM_NAME));
List<CLDevice> devices = platform.getDevices(CL_DEVICE_TYPE_ALL);
for (int deviceIndex = 0; deviceIndex < devices.size(); deviceIndex++) {
CLDevice device = devices.get(deviceIndex);
System.out.printf(Locale.ENGLISH, "Device #%d(%s):%s\n",
deviceIndex,
UtilCL.getDeviceType(device.getInfoInt(CL_DEVICE_TYPE)),
device.getInfoString(CL_DEVICE_NAME));
}
}
}
My output:
Platform #0:NVIDIA CUDA
Device #0(GPU):GeForce GTX 560 Ti
Device #1(GPU):GeForce GTX 560 Ti
My PC:
I am using lwjgl
version 2.8.4
Why am I not able to retreive my CPU?
Upvotes: 1
Views: 84
Reputation: 9925
(re-posting answer from comment)
OS X is somewhat unique in the fact that it comes with OpenCL CPU drivers pre-installed, so OpenCL works 'out-of-the-box'. On Windows and Linux, you need to install an OpenCL runtime/driver for your CPU. For Intel CPUs, you can find them here:
https://software.intel.com/en-us/articles/opencl-drivers
Upvotes: 1