admin
2022-08-02 c699b06ff750003b81315009e80617041748d799
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!");
      }