From 24ea443a29a3bb03ae942e215eb87d9fb9f6ed51 Mon Sep 17 00:00:00 2001 From: Jinzhe Zeng Date: Thu, 28 Mar 2024 20:43:39 -0400 Subject: [PATCH] fix error Signed-off-by: Jinzhe Zeng --- source/api_cc/src/common.cc | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) 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 != "") {