|
|
@@ -80,7 +80,7 @@ Status AiCoreOpTask::Init(const OpDesc &op_desc, |
|
|
|
GELOGD("Op [%s] allocate memory for outputs shape success, size=%zu", |
|
|
|
op_desc.GetName().c_str(), size); |
|
|
|
vector<char> default_value(size, 0); |
|
|
|
GE_CHK_RT_RET(rtMemory(shape_buffer_->GetData(), shape_buffer_->GetSize(), |
|
|
|
GE_CHK_RT_RET(rtMemcpy(shape_buffer_->GetData(), shape_buffer_->GetSize(), |
|
|
|
default_value.data(), size, |
|
|
|
RT_MEMCPY_HOST_TO_DEVICE)); |
|
|
|
return SUCCESS; |
|
|
@@ -122,7 +122,7 @@ Status AiCoreOpTask::UpdateOutputsShape(TaskContext &context) const { |
|
|
|
GELOGD("Node[%s] start update outputs shape.", context.GetNodeName()); |
|
|
|
GE_CHECK_NOTNULL(shape_buffer_); |
|
|
|
auto outputs_shape_buffer = |
|
|
|
std::unique_ptr<uint8_t[]>(new uint8_t[shape_buffer_->Getsize()]); |
|
|
|
std::unique_ptr<uint8_t[]>(new uint8_t[shape_buffer_->GetSize()]); |
|
|
|
GE_CHK_RT_RET(rtMemcpy(outputs_shape_buffer.get(), shape_buffer_->GetSize(), |
|
|
|
shape_buffer_->GetData(), shape_buffer_->GetSize(), |
|
|
|
RT_MEMCPY_DEVICE_TO_HOST)); |
|
|
@@ -151,7 +151,7 @@ Status AiCoreOpTask::UpdateShapeToOutputDesc(TaskContext &context, |
|
|
|
const int output_index) const { |
|
|
|
auto output_desc = context.MutableOutputDesc(output_index); |
|
|
|
GE_CHECK_NOTNULL(output_desc); |
|
|
|
auto shape_old = output_desc->GeShape(); |
|
|
|
auto shape_old = output_desc->GetShape(); |
|
|
|
auto origin_shape_old = output_desc->GetOriginShape(); |
|
|
|
GELOGD( |
|
|
|
"Node[%s] try to update output[%d] shape from %s to %s, origin_shape " |
|
|
|