Skip to content

Commit 53dab95

Browse files
committed
Static DSO handle
1 parent c511595 commit 53dab95

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

paddle/fluid/platform/dynload/cupti.h

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

paddle/fluid/platform/dynload/curand.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ extern void *curand_dso_handle;
3434
std::call_once(curand_dso_flag, []() { \
3535
curand_dso_handle = paddle::platform::dynload::GetCurandDsoHandle(); \
3636
}); \
37-
void *p_##__name = dlsym(curand_dso_handle, #__name); \
37+
static void *p_##__name = dlsym(curand_dso_handle, #__name); \
3838
return reinterpret_cast<curandFunc>(p_##__name)(args...); \
3939
} \
4040
}; \

paddle/fluid/platform/dynload/nccl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ extern void* nccl_dso_handle;
3737
std::call_once(nccl_dso_flag, []() { \
3838
nccl_dso_handle = paddle::platform::dynload::GetNCCLDsoHandle(); \
3939
}); \
40-
void* p_##__name = dlsym(nccl_dso_handle, #__name); \
40+
static void* p_##__name = dlsym(nccl_dso_handle, #__name); \
4141
return reinterpret_cast<nccl_func>(p_##__name)(args...); \
4242
} \
4343
}; \

paddle/fluid/platform/dynload/tensorrt.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ extern void* tensorrt_dso_handle;
4040
paddle::platform::dynload::GetTensorRtDsoHandle(); \
4141
PADDLE_ENFORCE(tensorrt_dso_handle, "load tensorrt so failed"); \
4242
}); \
43-
void* p_##__name = dlsym(tensorrt_dso_handle, #__name); \
43+
static void* p_##__name = dlsym(tensorrt_dso_handle, #__name); \
4444
PADDLE_ENFORCE(p_##__name, "load %s failed", #__name); \
4545
return reinterpret_cast<tensorrt_func>(p_##__name)(args...); \
4646
} \

paddle/fluid/platform/dynload/warpctc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ extern void* warpctc_dso_handle;
4040
std::call_once(warpctc_dso_flag, []() { \
4141
warpctc_dso_handle = paddle::platform::dynload::GetWarpCTCDsoHandle(); \
4242
}); \
43-
void* p_##_name = dlsym(warpctc_dso_handle, #__name); \
43+
static void* p_##_name = dlsym(warpctc_dso_handle, #__name); \
4444
return reinterpret_cast<warpctcFunc>(p_##_name)(args...); \
4545
} \
4646
}; \

0 commit comments

Comments
 (0)