Skip to content

Commit

Permalink
caffe2/core hipify (#13457)
Browse files Browse the repository at this point in the history
Summary:
Small edits to caffe2/core hipify to make it compile in fbcode.
Pull Request resolved: #13457

Reviewed By: bddppq

Differential Revision: D12883472

Pulled By: xw285cornell

fbshipit-source-id: 1da231d721311d105892db13ed726240398ba49e
  • Loading branch information
xw285cornell authored and facebook-github-bot committed Nov 1, 2018
1 parent 421f3f3 commit e6b6cc0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions caffe2/core/common_gpu.cc
Expand Up @@ -282,6 +282,10 @@ const char* cublasGetErrorString(cublasStatus_t error) {
return "CUBLAS_STATUS_LICENSE_ERROR";
#endif // CUDA_VERSION >= 6050
#endif // CUDA_VERSION >= 6000
#ifdef __HIPCC__
case rocblas_status_invalid_size:
return "rocblas_status_invalid_size";
#endif
}
// To suppress compiler warning.
return "Unrecognized cublas error string";
Expand Down Expand Up @@ -315,6 +319,10 @@ const char* curandGetErrorString(curandStatus_t error) {
return "CURAND_STATUS_ARCH_MISMATCH";
case CURAND_STATUS_INTERNAL_ERROR:
return "CURAND_STATUS_INTERNAL_ERROR";
#ifdef __HIPCC__
case HIPRAND_STATUS_NOT_IMPLEMENTED:
return "HIPRAND_STATUS_NOT_IMPLEMENTED";
#endif
}
// To suppress compiler warning.
return "Unrecognized curand error string";
Expand Down
2 changes: 1 addition & 1 deletion caffe2/core/common_gpu.h
Expand Up @@ -280,7 +280,7 @@ CAFFE2_CUDA_API const char* curandGetErrorString(curandStatus_t error);
// CUDA_KERNEL_ASSERT is a macro that wraps an assert() call inside cuda
// kernels. This is not supported by Apple platforms so we special case it.
// See http://docs.nvidia.com/cuda/cuda-c-programming-guide/#assertion
#ifdef __APPLE__
#if defined(__APPLE__) || defined(__HIPCC__)
#define CUDA_KERNEL_ASSERT(...)
#else // __APPLE__
#define CUDA_KERNEL_ASSERT(...) assert(__VA_ARGS__)
Expand Down

0 comments on commit e6b6cc0

Please sign in to comment.