我有一些这样的代码:
public static void main(String[] args) throws IOException {
CLContext context = JavaCL.createBestContext();
CLQueue queue = context.createDefaultQueue();
ByteOrder byteOrder = context.getByteOrder();
System.out.println(context.getDeviceCount() + "\n" + context.getDevices()[0].createSignature());
}
输出后我得到这个:
1
[Intel(R)UHD Graphics 630 | Intel(R)Corporation | 26.20.100.7263 | FULL_PROFILE
为什么会这样? (我的独立显卡是GTX1080)
我找到了NVIDIA CUDA平台和我的GTX1080,但我不明白如何创建NVIDIA CUDA平台的上下文。
已将此代码添加到过去的实现中
CLPlatform[] platforms = JavaCL.listPlatforms();
for (int i = 0; i < platforms.length; i++) {
System.out.println(platforms[i].getName());
System.out.println(platforms[i].getBestDevice());
}
我在输出中得到它:
NVIDIA CUDA
GeForce GTX 1080(NVIDIA CUDA)
Intel(R)OpenCL
[英特尔(R)UHD图形630(英特尔(R)OpenCL)