!4726 serving support mindata compiler flags for acl

Merge pull request !4726 from 徐永飞/master
pull/4726/MERGE
mindspore-ci-bot 5 years ago committed by Gitee
commit 7a8fbbbb4b

@ -392,11 +392,7 @@ build_mindspore()
if [[ -n "$VERBOSE" ]]; then
CMAKE_VERBOSE="--verbose"
fi
if [[ "X$ENABLE_ACL" = "Xon" ]]; then
cmake --build . ${CMAKE_VERBOSE} -j$THREAD_NUM
else
cmake --build . --target package ${CMAKE_VERBOSE} -j$THREAD_NUM
fi
echo "success to build mindspore project!"
}

@ -141,7 +141,7 @@ Status ServingTensor2MSTensor(size_t index, const InferTensorBase &out_tensor, t
}
ms_tensor = std::make_shared<tensor::Tensor>(data_type, shape);
if (ms_tensor->Size() != out_tensor.data_size()) {
if (out_tensor.data_size() == 0 || ms_tensor->Size() != out_tensor.data_size()) {
MSI_LOG_ERROR << "input " << std::to_string(index)
<< " data size not match shape and dtype, calculated required size " << ms_tensor->Size()
<< ", given " << out_tensor.data_size();
@ -149,6 +149,10 @@ Status ServingTensor2MSTensor(size_t index, const InferTensorBase &out_tensor, t
<< " data size not match shape and dtype, calculated required size "
<< ms_tensor->Size() << ", given " << out_tensor.data_size();
}
if (out_tensor.data() == nullptr || ms_tensor->data_c() == nullptr) {
MSI_LOG_ERROR << "invalid data buffer";
return FAILED;
}
memcpy_s(ms_tensor->data_c(), ms_tensor->Size(), out_tensor.data(), out_tensor.data_size());
return SUCCESS;
}

Loading…
Cancel
Save