提交 0d986b8f 编写于 作者: Z zhouwei25

test=develop

上级 2cb804e4
...@@ -109,10 +109,16 @@ int GetCUDAComputeCapability(int id) { ...@@ -109,10 +109,16 @@ int GetCUDAComputeCapability(int id) {
PADDLE_ENFORCE_LT(id, GetCUDADeviceCount(), "id must less than GPU count"); PADDLE_ENFORCE_LT(id, GetCUDADeviceCount(), "id must less than GPU count");
cudaDeviceProp device_prop; cudaDeviceProp device_prop;
auto e = cudaGetDeviceProperties(&device_prop, id); auto e = cudaGetDeviceProperties(&device_prop, id);
int a = 10; char ErrorLog[50];
char c[] = "helloworld"; snprintf(ErrorLog, sizeof(ErrorLog),
string str = "helloworld"; "cudaGetDeviceProperties failed in"
PADDLE_ENFORCE(cudaGetDeviceProperties(&device_prop, id), a, c, str); "paddle::platform::GetCUDAComputeCapability!"
"Error Type ID = %d , Detail:"
"https://docs.nvidia.com/cuda/cuda-runtime-api/"
"group__CUDART__TYPES.html#group__CUDART__TYPES_"
"1g3f51e3575c2178246db0a94a430e0038",
e);
PADDLE_ENFORCE(e, ErrorLog);
return device_prop.major * 10 + device_prop.minor; return device_prop.major * 10 + device_prop.minor;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册