From b57c132aab8423276de5f9e3391b1f120134ecff Mon Sep 17 00:00:00 2001 From: XiaoguangHu <46782768+XiaoguangHu01@users.noreply.github.com> Date: Wed, 4 May 2022 09:16:29 +0800 Subject: [PATCH] fix bug when compiling with cusparse in CUDA version >=11.4 (#42456) --- paddle/fluid/platform/dynload/cusparse.cc | 9 +++++---- paddle/phi/backends/dynload/cusparse.cc | 9 +++++---- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/paddle/fluid/platform/dynload/cusparse.cc b/paddle/fluid/platform/dynload/cusparse.cc index ea7c502e3e6..99843799754 100644 --- a/paddle/fluid/platform/dynload/cusparse.cc +++ b/paddle/fluid/platform/dynload/cusparse.cc @@ -24,13 +24,14 @@ namespace dynload { CUSPARSE_ROUTINE_EACH(DEFINE_WRAP); #endif -#ifdef CUBLAS_BLAS_ROUTINE_EACH_R2 -CUSPARSE_ROUTINE_EACH_R2(DEFINE_WRAP); -#endif - #ifdef CUSPARSE_ROUTINE_EACH_11020 CUSPARSE_ROUTINE_EACH_11020(DEFINE_WRAP); #endif + +#ifdef CUSPARSE_ROUTINE_EACH_R2 +CUSPARSE_ROUTINE_EACH_R2(DEFINE_WRAP); +#endif + } // namespace dynload } // namespace platform } // namespace paddle diff --git a/paddle/phi/backends/dynload/cusparse.cc b/paddle/phi/backends/dynload/cusparse.cc index a37fbf35a26..326645726bb 100644 --- a/paddle/phi/backends/dynload/cusparse.cc +++ b/paddle/phi/backends/dynload/cusparse.cc @@ -26,12 +26,13 @@ void *cusparse_dso_handle; CUSPARSE_ROUTINE_EACH(DEFINE_WRAP); #endif -#ifdef CUBLAS_BLAS_ROUTINE_EACH_R2 -CUSPARSE_ROUTINE_EACH_R2(DEFINE_WRAP); -#endif - #ifdef CUSPARSE_ROUTINE_EACH_11020 CUSPARSE_ROUTINE_EACH_11020(DEFINE_WRAP); #endif + +#ifdef CUSPARSE_ROUTINE_EACH_R2 +CUSPARSE_ROUTINE_EACH_R2(DEFINE_WRAP); +#endif + } // namespace dynload } // namespace phi -- GitLab