|
|
@ -53,12 +53,6 @@ namespace platform {
|
|
|
|
namespace dynload {
|
|
|
|
namespace dynload {
|
|
|
|
static constexpr char cupti_lib_path[] = CUPTI_LIB_PATH;
|
|
|
|
static constexpr char cupti_lib_path[] = CUPTI_LIB_PATH;
|
|
|
|
|
|
|
|
|
|
|
|
#if defined(_WIN32) && defined(PADDLE_WITH_CUDA)
|
|
|
|
|
|
|
|
static constexpr char* win_cublas_lib = "cublas64_" PADDLE_CUDA_BINVER ".dll";
|
|
|
|
|
|
|
|
static constexpr char* win_curand_lib = "curand64_" PADDLE_CUDA_BINVER ".dll";
|
|
|
|
|
|
|
|
static constexpr char* win_cudnn_lib = "cudnn64_" PADDLE_CUDNN_BINVER ".dll";
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline std::string join(const std::string& part1,
|
|
|
|
static inline std::string join(const std::string& part1,
|
|
|
|
const std::string& part2) {
|
|
|
|
const std::string& part2) {
|
|
|
|
// directory separator
|
|
|
|
// directory separator
|
|
|
@ -171,8 +165,6 @@ static inline void* GetDsoHandleFromSearchPath(const std::string& search_root,
|
|
|
|
void* GetCublasDsoHandle() {
|
|
|
|
void* GetCublasDsoHandle() {
|
|
|
|
#if defined(__APPLE__) || defined(__OSX__)
|
|
|
|
#if defined(__APPLE__) || defined(__OSX__)
|
|
|
|
return GetDsoHandleFromSearchPath(FLAGS_cuda_dir, "libcublas.dylib");
|
|
|
|
return GetDsoHandleFromSearchPath(FLAGS_cuda_dir, "libcublas.dylib");
|
|
|
|
#elif defined(_WIN32) && defined(PADDLE_WITH_CUDA)
|
|
|
|
|
|
|
|
return GetDsoHandleFromSearchPath(FLAGS_cuda_dir, win_cublas_lib);
|
|
|
|
|
|
|
|
#else
|
|
|
|
#else
|
|
|
|
return GetDsoHandleFromSearchPath(FLAGS_cuda_dir, "libcublas.so");
|
|
|
|
return GetDsoHandleFromSearchPath(FLAGS_cuda_dir, "libcublas.so");
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
@ -181,8 +173,6 @@ void* GetCublasDsoHandle() {
|
|
|
|
void* GetCUDNNDsoHandle() {
|
|
|
|
void* GetCUDNNDsoHandle() {
|
|
|
|
#if defined(__APPLE__) || defined(__OSX__)
|
|
|
|
#if defined(__APPLE__) || defined(__OSX__)
|
|
|
|
return GetDsoHandleFromSearchPath(FLAGS_cudnn_dir, "libcudnn.dylib", false);
|
|
|
|
return GetDsoHandleFromSearchPath(FLAGS_cudnn_dir, "libcudnn.dylib", false);
|
|
|
|
#elif defined(_WIN32) && defined(PADDLE_WITH_CUDA)
|
|
|
|
|
|
|
|
return GetDsoHandleFromSearchPath(FLAGS_cudnn_dir, win_cudnn_lib);
|
|
|
|
|
|
|
|
#else
|
|
|
|
#else
|
|
|
|
return GetDsoHandleFromSearchPath(FLAGS_cudnn_dir, "libcudnn.so", false);
|
|
|
|
return GetDsoHandleFromSearchPath(FLAGS_cudnn_dir, "libcudnn.so", false);
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
@ -203,8 +193,6 @@ void* GetCUPTIDsoHandle() {
|
|
|
|
void* GetCurandDsoHandle() {
|
|
|
|
void* GetCurandDsoHandle() {
|
|
|
|
#if defined(__APPLE__) || defined(__OSX__)
|
|
|
|
#if defined(__APPLE__) || defined(__OSX__)
|
|
|
|
return GetDsoHandleFromSearchPath(FLAGS_cuda_dir, "libcurand.dylib");
|
|
|
|
return GetDsoHandleFromSearchPath(FLAGS_cuda_dir, "libcurand.dylib");
|
|
|
|
#elif defined(_WIN32) && defined(PADDLE_WITH_CUDA)
|
|
|
|
|
|
|
|
return GetDsoHandleFromSearchPath(FLAGS_cuda_dir, win_curand_lib);
|
|
|
|
|
|
|
|
#else
|
|
|
|
#else
|
|
|
|
return GetDsoHandleFromSearchPath(FLAGS_cuda_dir, "libcurand.so");
|
|
|
|
return GetDsoHandleFromSearchPath(FLAGS_cuda_dir, "libcurand.so");
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
@ -213,8 +201,6 @@ void* GetCurandDsoHandle() {
|
|
|
|
void* GetWarpCTCDsoHandle() {
|
|
|
|
void* GetWarpCTCDsoHandle() {
|
|
|
|
#if defined(__APPLE__) || defined(__OSX__)
|
|
|
|
#if defined(__APPLE__) || defined(__OSX__)
|
|
|
|
return GetDsoHandleFromSearchPath(FLAGS_warpctc_dir, "libwarpctc.dylib");
|
|
|
|
return GetDsoHandleFromSearchPath(FLAGS_warpctc_dir, "libwarpctc.dylib");
|
|
|
|
#elif defined(_WIN32)
|
|
|
|
|
|
|
|
return GetDsoHandleFromSearchPath(FLAGS_warpctc_dir, "warpctc.dll");
|
|
|
|
|
|
|
|
#else
|
|
|
|
#else
|
|
|
|
return GetDsoHandleFromSearchPath(FLAGS_warpctc_dir, "libwarpctc.so");
|
|
|
|
return GetDsoHandleFromSearchPath(FLAGS_warpctc_dir, "libwarpctc.so");
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
@ -239,8 +225,6 @@ void* GetTensorRtDsoHandle() {
|
|
|
|
void* GetMKLMLDsoHandle() {
|
|
|
|
void* GetMKLMLDsoHandle() {
|
|
|
|
#if defined(__APPLE__) || defined(__OSX__)
|
|
|
|
#if defined(__APPLE__) || defined(__OSX__)
|
|
|
|
return GetDsoHandleFromSearchPath(FLAGS_mklml_dir, "libmklml_intel.dylib");
|
|
|
|
return GetDsoHandleFromSearchPath(FLAGS_mklml_dir, "libmklml_intel.dylib");
|
|
|
|
#elif defined(_WIN32)
|
|
|
|
|
|
|
|
return GetDsoHandleFromSearchPath(FLAGS_mklml_dir, "mklml.dll");
|
|
|
|
|
|
|
|
#else
|
|
|
|
#else
|
|
|
|
return GetDsoHandleFromSearchPath(FLAGS_mklml_dir, "libmklml_intel.so");
|
|
|
|
return GetDsoHandleFromSearchPath(FLAGS_mklml_dir, "libmklml_intel.so");
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|