!46514 Add converter.h API docs and add it to release pkg

Merge pull request !46514 from 刘崇鸣/add_converter_header_to_pkg
This commit is contained in:
i-robot 2022-12-09 06:04:00 +00:00 committed by Gitee
commit f8dafdc71d
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 18 additions and 0 deletions

View File

@ -504,6 +504,8 @@ if(PLATFORM_ARM64)
${RUNTIME_COMPONENT_NAME})
endif()
if(MSLITE_ENABLE_CONVERTER)
install(FILES ${TOP_DIR}/mindspore/lite/include/converter.h DESTINATION ${CONVERTER_ROOT_DIR}/include
COMPONENT ${RUNTIME_COMPONENT_NAME})
install(DIRECTORY ${TOP_DIR}/mindspore/lite/include/registry/ DESTINATION
${CONVERTER_ROOT_DIR}/include/registry COMPONENT ${RUNTIME_COMPONENT_NAME})
install(FILES ${API_HEADER} DESTINATION ${CONVERTER_ROOT_DIR}/include/api
@ -724,6 +726,8 @@ elseif(WIN32)
file(GLOB LIB_LIST ${CXX_DIR}/libstdc++-6.dll ${CXX_DIR}/libwinpthread-1.dll
${CXX_DIR}/libssp-0.dll ${CXX_DIR}/libgcc_s_*-1.dll)
if(MSLITE_ENABLE_CONVERTER)
install(FILES ${TOP_DIR}/mindspore/lite/include/converter.h DESTINATION ${CONVERTER_ROOT_DIR}/include
COMPONENT ${RUNTIME_COMPONENT_NAME})
install(FILES ${TOP_DIR}/build/mindspore/tools/converter/converter_lite/converter_lite.exe
DESTINATION ${CONVERTER_ROOT_DIR}/converter COMPONENT ${RUNTIME_COMPONENT_NAME})
install(FILES ${TOP_DIR}/build/mindspore/tools/converter/libmindspore_converter.dll
@ -885,6 +889,8 @@ else()
COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h")
endif()
if(MSLITE_ENABLE_CONVERTER)
install(FILES ${TOP_DIR}/mindspore/lite/include/converter.h DESTINATION ${CONVERTER_ROOT_DIR}/include
COMPONENT ${RUNTIME_COMPONENT_NAME})
install(FILES ${TOP_DIR}/mindspore/lite/include/kernel_interface.h DESTINATION ${CONVERTER_ROOT_DIR}/include
COMPONENT ${RUNTIME_COMPONENT_NAME})
install(DIRECTORY ${TOP_DIR}/mindspore/lite/include/registry/ DESTINATION ${CONVERTER_ROOT_DIR}/include/registry

View File

@ -27,6 +27,11 @@
namespace mindspore {
struct ConverterPara;
/// \brief Converter provides C++ API for user to integrate model conversion into user application.
///
/// \note Converter C++ API cannot be used in Converter main process.
///
/// \note Converter C++ API doesn't support calling with multi-threads in a single process.
class MS_API Converter {
public:
inline Converter(converter::FmkType fmk_type, const std::string &model_file, const std::string &output_file = "",
@ -81,7 +86,14 @@ class MS_API Converter {
inline void SetDevice(const std::string &device);
inline std::string GetDevice();
/// \brief Convert model and save .ms format model into `output_file` that passed in constructor.
Status Convert();
/// \brief Convert model and return converted FlatBuffer model binary buffer.
///
/// \param[in] data_size Converted FlatBuffer model's buffer size.
///
/// \return A pointer to converted FlatBuffer model buffer.
void *Convert(size_t *data_size);
private: