diff --git a/paddle/math/MathFunctions.cpp b/paddle/math/MathFunctions.cpp index 895ae104befa3a38269f545eb2046e18ee3afdef..1ed25728bc1ca8d1577e6abbfd319da8447d14e7 100644 --- a/paddle/math/MathFunctions.cpp +++ b/paddle/math/MathFunctions.cpp @@ -32,7 +32,7 @@ void* lapack_dso_handle = nullptr; #define DYNAMIC_LOAD_LAPACK_WRAP(__name) \ struct DynLoad__##__name { \ template \ - int operator()(Args... args)->decltype(__name(args...)) { \ + auto operator()(Args... args)->decltype(__name(args...)) { \ using lapack_func = decltype(__name(args...)) (*)(Args...); \ std::call_once(lapack_dso_flag, GetLapackDsoHandle, &lapack_dso_handle); \ void* p_##__name = dlsym(lapack_dso_handle, #__name); \ @@ -47,15 +47,18 @@ void* lapack_dso_handle = nullptr; __macro(clapack_sgetrf) \ __macro(clapack_dgetrf) \ __macro(clapack_sgetri) \ - __macro(clapack_dgetri) + __macro(clapack_dgetri) #else #define LAPACK_ROUTINE_EACH(__macro) \ __macro(LAPACKE_sgetrf) \ __macro(LAPACKE_dgetrf) \ __macro(LAPACKE_sgetri) \ - __macro(LAPACKE_dgetri) + __macro(LAPACKE_dgetri) #endif #endif + +LAPACK_ROUTINE_EACH(DYNAMIC_LOAD_LAPACK_WRAP) + // clang-format on } // namespace dynload diff --git a/paddle/utils/DynamicLoad.cc b/paddle/utils/DynamicLoad.cpp similarity index 100% rename from paddle/utils/DynamicLoad.cc rename to paddle/utils/DynamicLoad.cpp diff --git a/paddle/utils/DynamicLoad.h b/paddle/utils/DynamicLoad.h index 5587993f8747149ed54d6742e6292dd6fae20fde..67f52a3a5dab9a5f4429a7e0eceff0cb5df041be 100644 --- a/paddle/utils/DynamicLoad.h +++ b/paddle/utils/DynamicLoad.h @@ -12,12 +12,13 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#ifndef HL_DYNAMIC_LOAD_H_ -#define HL_DYNAMIC_LOAD_H_ +#ifndef DYNAMIC_LOAD_H_ +#define DYNAMIC_LOAD_H_ #include #include #include +#include /** * @brief load the DSO of CUBLAS @@ -59,4 +60,4 @@ void GetWarpCTCDsoHandle(void** dso_handle); */ void GetLapackDsoHandle(void** dso_handle); -#endif // HL_DYNAMIC_LOAD_H_ +#endif // DYNAMIC_LOAD_H_