From 93a5632a1f680c0926f09145c1a880e386be5f36 Mon Sep 17 00:00:00 2001 From: yuhanshi Date: Tue, 14 Feb 2023 21:13:49 +0800 Subject: [PATCH] Add version script to reduce library size. Signed-off-by: yuhanshi --- frameworks/BUILD.gn | 1 + frameworks/neural_network_runtime.map | 40 +++++++++++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 frameworks/neural_network_runtime.map diff --git a/frameworks/BUILD.gn b/frameworks/BUILD.gn index 34b7da3..200f489 100644 --- a/frameworks/BUILD.gn +++ b/frameworks/BUILD.gn @@ -98,6 +98,7 @@ ops_sources = [ ohos_shared_library("libneural_network_runtime") { sources = nnrt_sources sources += ops_sources + version_script = "neural_network_runtime.map" include_dirs = [ "//commonlibrary/c_utils/base/include", "//drivers/hdf_core/adapter/uhdf/posix/include", diff --git a/frameworks/neural_network_runtime.map b/frameworks/neural_network_runtime.map new file mode 100644 index 0000000..4f570b0 --- /dev/null +++ b/frameworks/neural_network_runtime.map @@ -0,0 +1,40 @@ +{ + global: + OH_NNModel_Construct; + OH_NNModel_AddTensor; + OH_NNModel_SetTensorData; + OH_NNModel_AddOperation; + OH_NNModel_SpecifyInputsAndOutputs; + OH_NNModel_Finish; + OH_NNModel_Destroy; + OH_NNModel_GetAvailableOperations; + OH_NNModel_BuildFromLiteGraph; + OH_NNCompilation_Construct; + OH_NNCompilation_SetDevice; + OH_NNCompilation_SetCache; + OH_NNCompilation_SetPerformance; + OH_NNCompilation_SetPriority; + OH_NNCompilation_EnableFloat16; + OH_NNCompilation_Build; + OH_NNCompilation_Destroy; + OH_NNExecutor_Construct; + OH_NNExecutor_SetInput; + OH_NNExecutor_SetOutput; + OH_NNExecutor_GetOutputShape; + OH_NNExecutor_Run; + OH_NNExecutor_AllocateInputMemory; + OH_NNExecutor_AllocateOutputMemory; + OH_NNExecutor_DestroyInputMemory; + OH_NNExecutor_DestroyOutputMemory; + OH_NNExecutor_SetInputWithMemory; + OH_NNExecutor_SetOutputWithMemory; + OH_NNExecutor_Destroy; + OH_NNExecutor_GetAllDevicesID; + OH_NNExecutor_GetName; + OH_NNExecutor_GetType; + extern "C++" { + OHOS::NeuralNetworkRuntime::MemoryManager::MapMemory*; + }; + local: + *; +}; \ No newline at end of file -- Gitee