提交 7a8fbbbb 编写于 作者: M mindspore-ci-bot 提交者: Gitee

!4726 serving support mindata compiler flags for acl

Merge pull request !4726 from 徐永飞/master
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册