mindspore lite: solve cloud infer no return warning

This commit is contained in:
liu lili 2022-05-10 15:10:06 +08:00
parent 2174af2436
commit 9415ff230b
2 changed files with 33 additions and 3 deletions

View File

@ -147,9 +147,10 @@ set(MODEL_LOADER_FRAMEWORK_SRC
if(MSLITE_ENABLE_CLOUD_FUSION_INFERENCE)
add_compile_definitions(ENABLE_CLOUD_FUSION_INFERENCE)
remove_definitions(-DBUILD_LITE_INFERENCE)
string(REPLACE "-Werror" "" CMAKE_C_FLAGS ${CMAKE_C_FLAGS})
string(REPLACE "-Werror" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
# string(REPLACE "-Werror" "" CMAKE_C_FLAGS ${CMAKE_C_FLAGS})
# string(REPLACE "-Werror" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
# set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-error=return-type")
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-error=return-type")
@ -168,7 +169,8 @@ set(MINDIR_KERNEL_SRC
set(LITE_SRC
${LITE_SRC}
${CMAKE_CURRENT_SOURCE_DIR}/model_loader/mindir_model/less_test_kernel_mod.cc)
${CMAKE_CURRENT_SOURCE_DIR}/model_loader/mindir_model/less_test_kernel_mod.cc
${CMAKE_CURRENT_SOURCE_DIR}/model_loader/mindir_model/kernel_mod_mock.cc)
endif()
set(LITE_SRC

View File

@ -0,0 +1,28 @@
/**
* Copyright 2021-2022 Huawei Technologies Co., Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <vector>
#include <map>
#include "kernel/kernel.h"
namespace mindspore::kernel {
int KernelMod::Resize(const BaseOperatorPtr &base_operator, const std::vector<KernelTensorPtr> &inputs,
const std::vector<KernelTensorPtr> &outputs,
const std::map<uint32_t, tensor::TensorPtr> &inputsOnHost) {
return KRET_OK;
}
} // namespace mindspore::kernel