From c699b06ff750003b81315009e80617041748d799 Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期二, 02 八月 2022 18:06:16 +0800 Subject: [PATCH] '完善' --- ConsoleApplication/OpenCLExcuter.cpp | 13 +++++++++++-- 1 files changed, 11 insertions(+), 2 deletions(-) diff --git a/ConsoleApplication/OpenCLExcuter.cpp b/ConsoleApplication/OpenCLExcuter.cpp index 65c011d..7df4069 100644 --- a/ConsoleApplication/OpenCLExcuter.cpp +++ b/ConsoleApplication/OpenCLExcuter.cpp @@ -7,9 +7,18 @@ throw string("Get platform failed!"); } //获取设备 - error = clGetDeviceIDs(platforms, CL_DEVICE_TYPE_GPU, 1, &devices, NULL); + //error = clGetDeviceIDs(platforms, CL_DEVICE_TYPE_GPU, 1, &devices, NULL); + //if (error != 0) { + // error = clGetDeviceIDs(platforms, CL_DEVICE_TYPE_CPU, 1, &devices, NULL); + // if (error != 0) { + // throw string("Get device failed!"); + // } + //} + + + error = clGetDeviceIDs(platforms, CL_DEVICE_TYPE_CPU, 1, &devices, NULL); if (error != 0) { - error = clGetDeviceIDs(platforms, CL_DEVICE_TYPE_CPU, 1, &devices, NULL); + error = clGetDeviceIDs(platforms, CL_DEVICE_TYPE_GPU, 1, &devices, NULL); if (error != 0) { throw string("Get device failed!"); } -- Gitblit v1.8.0