| | |
| | | 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!"); |
| | | } |