我打算对CPU和GPU之间的区别进行基准测试。问题是,我只能撤回我的GPU,我的CPU没有显示。
该程序在OSX上产生正确的输出。在这里,CPU和GPU被列出:
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));
}
}
}我的产出:
平台#0:NVIDIA CUDA 装置#0(GPU):GeForce GTX 560 Ti 设备#1(GPU):GeForce GTX 560 Ti
我的电脑:
我使用的是lwjgl版本2.8.4
为什么我不能收回我的CPU?
发布于 2015-04-21 12:55:11
(回复评论)
OS在某种程度上是独一无二的,因为它带有预先安装的OpenCL CPU驱动程序,因此OpenCL可以“开箱即用”。在Windows和Linux上,您需要为您的CPU安装一个OpenCL运行时/驱动程序。对于Intel CPU,您可以在这里找到它们:
https://stackoverflow.com/questions/29761149
复制相似问题