Browse Source

!4726 serving support mindata compiler flags for acl

Merge pull request !4726 from 徐永飞/master
tags/v0.7.0-beta
mindspore-ci-bot Gitee 5 years ago
parent
commit
7a8fbbbb4b
2 changed files with 5 additions and 5 deletions
  1. +0
    -4
      build.sh
  2. +5
    -1
      mindspore/ccsrc/backend/session/infer_session.cc

+ 0
- 4
build.sh View File

@@ -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!"
}



+ 5
- 1
mindspore/ccsrc/backend/session/infer_session.cc View File

@@ -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