You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2018/08/09 01:09:27 UTC
[GitHub] eric-haibin-lin commented on a change in pull request #12031: Fix
CPUPinned unexpected behaviour
eric-haibin-lin commented on a change in pull request #12031: Fix CPUPinned unexpected behaviour
URL: https://github.com/apache/incubator-mxnet/pull/12031#discussion_r208780970
##########
File path: src/common/cuda_utils.h
##########
@@ -179,113 +283,38 @@ inline DType __device__ CudaMin(DType a, DType b) {
return a < b ? a : b;
}
-} // namespace cuda
-} // namespace common
-} // namespace mxnet
-
-/*!
- * \brief Check CUDA error.
- * \param msg Message to print if an error occured.
- */
-#define CHECK_CUDA_ERROR(msg) \
- { \
- cudaError_t e = cudaGetLastError(); \
- CHECK_EQ(e, cudaSuccess) << (msg) << " CUDA: " << cudaGetErrorString(e); \
- }
-
-/*!
- * \brief Protected CUDA call.
- * \param func Expression to call.
- *
- * It checks for CUDA errors after invocation of the expression.
- */
-#define CUDA_CALL(func) \
- { \
- cudaError_t e = (func); \
- CHECK(e == cudaSuccess || e == cudaErrorCudartUnloading) \
- << "CUDA: " << cudaGetErrorString(e); \
- }
-
-/*!
- * \brief Protected cuBLAS call.
- * \param func Expression to call.
- *
- * It checks for cuBLAS errors after invocation of the expression.
- */
-#define CUBLAS_CALL(func) \
- { \
- cublasStatus_t e = (func); \
- CHECK_EQ(e, CUBLAS_STATUS_SUCCESS) \
- << "cuBLAS: " << mxnet::common::cuda::CublasGetErrorString(e); \
- }
-
-/*!
- * \brief Protected cuSolver call.
- * \param func Expression to call.
- *
- * It checks for cuSolver errors after invocation of the expression.
- */
-#define CUSOLVER_CALL(func) \
- { \
- cusolverStatus_t e = (func); \
- CHECK_EQ(e, CUSOLVER_STATUS_SUCCESS) \
- << "cuSolver: " << mxnet::common::cuda::CusolverGetErrorString(e); \
- }
-
-/*!
- * \brief Protected cuRAND call.
- * \param func Expression to call.
- *
- * It checks for cuRAND errors after invocation of the expression.
- */
-#define CURAND_CALL(func) \
- { \
- curandStatus_t e = (func); \
- CHECK_EQ(e, CURAND_STATUS_SUCCESS) \
- << "cuRAND: " << mxnet::common::cuda::CurandGetErrorString(e); \
+class SetDevice {
Review comment:
Rename to DeviceScope, add a member function SetDevice, and remove all occurrences of `cudaGetDevice`?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services