diff --git a/source/api_cc/src/common.cc b/source/api_cc/src/common.cc index 07b6a10220..8f5e21c933 100644 --- a/source/api_cc/src/common.cc +++ b/source/api_cc/src/common.cc @@ -377,15 +377,6 @@ void deepmd::get_env_nthreads(int& num_intra_nthreads, } } -void deepmd::load_op_library() { -#ifdef BUILD_TENSORFLOW - _load_single_op_library("deepmd_op") -#endif -#ifdef BUILD_PYTORCH - _load_single_op_library("deepmd_op_pt") -#endif -} - static inline void _load_single_op_library(std::string library_name) { #if defined(_WIN32) std::string dso_path = library_name + ".dll"; @@ -401,6 +392,15 @@ static inline void _load_single_op_library(std::string library_name) { } } +void deepmd::load_op_library() { +#ifdef BUILD_TENSORFLOW + _load_single_op_library("deepmd_op"); +#endif +#ifdef BUILD_PYTORCH + _load_single_op_library("deepmd_op_pt"); +#endif +} + std::string deepmd::name_prefix(const std::string& scope) { std::string prefix = ""; if (scope != "") {