Created by: chenwhql
This PR change CUDA_ENFORCE to adapt new error system, and increase the examples of new error message writing specification.
Original:
EXPECT_TRUE(CheckCudaStatusFailure(cudaErrorInvalidValue));
12: ----------------------
12: Error Message Summary:
12: ----------------------
12: self-defined cuda status failed: invalid argument at (/work/paddle/paddle/fluid/platform/enforce_test.cc:271)
EXPECT_TRUE(CheckCudaStatusSuccess(CURAND_STATUS_SUCCESS));
12: ----------------------
12: Error Message Summary:
12: ----------------------
12: self-defined cuda status failed: unspecified launch failure at (/work/paddle/paddle/fluid/platform/enforce_test.cc:271)
EXPECT_TRUE(CheckCudaStatusFailure(CUDNN_STATUS_ALLOC_FAILED));
12: ----------------------
12: Error Message Summary:
12: ----------------------
12: CUDNN_STATUS_ALLOC_FAILEDself-defined cuda status failed at (/work/paddle/paddle/fluid/platform/enforce_test.cc:271)
EXPECT_TRUE(CheckCudaStatusFailure(CUBLAS_STATUS_NOT_INITIALIZED));
12: ----------------------
12: Error Message Summary:
12: ----------------------
12: CUBLAS: not initialized, self-defined cuda status failed at (/work/paddle/paddle/fluid/platform/enforce_test.cc:271)
EXPECT_TRUE(CheckCudaStatusFailure(ncclUnhandledCudaError));
12: ----------------------
12: Error Message Summary:
12: ----------------------
12: unhandled cuda errorself-defined cuda status failed at (/work/paddle/paddle/fluid/platform/enforce_test.cc:271)
New:
EXPECT_TRUE(CheckCudaStatusFailure(cudaErrorInvalidValue));
12: ----------------------
12: Error Message Summary:
12: ----------------------
12: Error: self-defined cuda status failed: invalid argument at (/work/paddle/paddle/fluid/platform/enforce_test.cc:271)
EXPECT_TRUE(CheckCudaStatusSuccess(CURAND_STATUS_SUCCESS));
12: ----------------------
12: Error Message Summary:
12: ----------------------
12: Error: self-defined cuda status failed: unspecified launch failure at (/work/paddle/paddle/fluid/platform/enforce_test.cc:271)
EXPECT_TRUE(CheckCudaStatusFailure(CUDNN_STATUS_ALLOC_FAILED));
12: ----------------------
12: Error Message Summary:
12: ----------------------
12: Error: self-defined cuda status failed
12: [CUDNN_STATUS_ALLOC_FAILED] at (/work/paddle/paddle/fluid/platform/enforce_test.cc:271)
EXPECT_TRUE(CheckCudaStatusFailure(CUBLAS_STATUS_NOT_INITIALIZED));
12: ----------------------
12: Error Message Summary:
12: ----------------------
12: Error: self-defined cuda status failed
12: [CUBLAS: not initialized.] at (/work/paddle/paddle/fluid/platform/enforce_test.cc:271)
EXPECT_TRUE(CheckCudaStatusFailure(ncclUnhandledCudaError));
12: ----------------------
12: Error Message Summary:
12: ----------------------
12: Error: self-defined cuda status failed
12: [unhandled cuda error] at (/work/paddle/paddle/fluid/platform/enforce_test.cc:271)