Skip to content

Commit c511595

Browse files
committed
Use static for dlsym
1 parent 7cf8b65 commit c511595

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

paddle/fluid/platform/dynload/cublas.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ extern void *cublas_dso_handle;
4545
std::call_once(cublas_dso_flag, []() { \
4646
cublas_dso_handle = paddle::platform::dynload::GetCublasDsoHandle(); \
4747
}); \
48-
void *p_##__name = dlsym(cublas_dso_handle, #__name); \
48+
static void *p_##__name = dlsym(cublas_dso_handle, #__name); \
4949
return reinterpret_cast<FUNC_TYPE>(p_##__name)(args...); \
5050
} \
5151
}; \

paddle/fluid/platform/dynload/cudnn.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ extern void EnforceCUDNNLoaded(const char* fn_name);
3939
cudnn_dso_handle = paddle::platform::dynload::GetCUDNNDsoHandle(); \
4040
}); \
4141
EnforceCUDNNLoaded(#__name); \
42-
void* p_##__name = dlsym(cudnn_dso_handle, #__name); \
42+
static void* p_##__name = dlsym(cudnn_dso_handle, #__name); \
4343
return reinterpret_cast<cudnn_func>(p_##__name)(args...); \
4444
} \
4545
}; \

0 commit comments

Comments
 (0)