|
@@ -293,25 +293,26 @@ Status TbeOpTask::UpdateNodeByShape(const vector<GeTensorDesc> &input_desc, cons |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
Status TbeOpTask::EnableDynamicSupport(const NodePtr &node, void *tiling_buffer, uint32_t max_tiling_size) { |
|
|
Status TbeOpTask::EnableDynamicSupport(const NodePtr &node, void *tiling_buffer, uint32_t max_tiling_size) { |
|
|
|
|
|
node_ = node; |
|
|
|
|
|
tiling_buffer_ = tiling_buffer; |
|
|
|
|
|
max_tiling_size_ = max_tiling_size; |
|
|
if (tiling_buffer != nullptr) { |
|
|
if (tiling_buffer != nullptr) { |
|
|
uintptr_t *arg_base = reinterpret_cast<uintptr_t *>(args_.get()); |
|
|
|
|
|
size_t arg_num = arg_size_ / sizeof(void *); |
|
|
|
|
|
|
|
|
uintptr_t *arg_base = nullptr; |
|
|
|
|
|
size_t arg_num = 0; |
|
|
|
|
|
GetIoAddr(arg_base, arg_num); |
|
|
GE_CHECK_NOTNULL(node); |
|
|
GE_CHECK_NOTNULL(node); |
|
|
GE_CHECK_NOTNULL(node->GetOpDesc()); |
|
|
GE_CHECK_NOTNULL(node->GetOpDesc()); |
|
|
uint32_t inputs_num = node->GetOpDesc()->GetInputsSize(); |
|
|
uint32_t inputs_num = node->GetOpDesc()->GetInputsSize(); |
|
|
uint32_t outputs_num = node->GetOpDesc()->GetOutputsSize(); |
|
|
uint32_t outputs_num = node->GetOpDesc()->GetOutputsSize(); |
|
|
uint32_t workspace_nums = node->GetOpDesc()->GetWorkspace().size(); |
|
|
uint32_t workspace_nums = node->GetOpDesc()->GetWorkspace().size(); |
|
|
uint32_t tiling_index = inputs_num + outputs_num + workspace_nums; |
|
|
uint32_t tiling_index = inputs_num + outputs_num + workspace_nums; |
|
|
if (arg_num == 0 || arg_num <= tiling_index) { |
|
|
|
|
|
|
|
|
if (arg_num == 0 || arg_num < tiling_index) { |
|
|
GELOGE(ACL_ERROR_GE_INTERNAL_ERROR, "[Check][Size]Tiling index %u, arg number %zu is invalid.", |
|
|
GELOGE(ACL_ERROR_GE_INTERNAL_ERROR, "[Check][Size]Tiling index %u, arg number %zu is invalid.", |
|
|
tiling_index, arg_num); |
|
|
tiling_index, arg_num); |
|
|
return ACL_ERROR_GE_INTERNAL_ERROR; |
|
|
return ACL_ERROR_GE_INTERNAL_ERROR; |
|
|
} |
|
|
} |
|
|
arg_base[tiling_index] = reinterpret_cast<uintptr_t>(tiling_buffer); |
|
|
arg_base[tiling_index] = reinterpret_cast<uintptr_t>(tiling_buffer); |
|
|
} |
|
|
} |
|
|
node_ = node; |
|
|
|
|
|
tiling_buffer_ = tiling_buffer; |
|
|
|
|
|
max_tiling_size_ = max_tiling_size; |
|
|
|
|
|
return SUCCESS; |
|
|
return SUCCESS; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@@ -481,20 +482,21 @@ void TbeOpTask::GetIoAddr(uintptr_t *&arg_base, size_t &arg_count) { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
Status AtomicAddrCleanOpTask::EnableDynamicSupport(const NodePtr &node, void *tiling_buffer, uint32_t max_tiling_size) { |
|
|
Status AtomicAddrCleanOpTask::EnableDynamicSupport(const NodePtr &node, void *tiling_buffer, uint32_t max_tiling_size) { |
|
|
|
|
|
node_ = node; |
|
|
|
|
|
tiling_buffer_ = tiling_buffer; |
|
|
|
|
|
max_tiling_size_ = max_tiling_size; |
|
|
if (tiling_buffer != nullptr) { |
|
|
if (tiling_buffer != nullptr) { |
|
|
uintptr_t *arg_base = reinterpret_cast<uintptr_t *>(args_.get()); |
|
|
|
|
|
size_t arg_num = arg_size_ / sizeof(void *); |
|
|
|
|
|
|
|
|
uintptr_t *arg_base = nullptr; |
|
|
|
|
|
size_t arg_num = 0; |
|
|
|
|
|
GetIoAddr(arg_base, arg_num); |
|
|
uint32_t tiling_index = atomic_output_indices_.size(); |
|
|
uint32_t tiling_index = atomic_output_indices_.size(); |
|
|
if (arg_num == 0 || arg_num <= tiling_index) { |
|
|
|
|
|
|
|
|
if (arg_num == 0 || arg_num < tiling_index) { |
|
|
GELOGE(ACL_ERROR_GE_INTERNAL_ERROR, "[Check][Size]Tiling index %u, arg number %zu is invalid.", |
|
|
GELOGE(ACL_ERROR_GE_INTERNAL_ERROR, "[Check][Size]Tiling index %u, arg number %zu is invalid.", |
|
|
tiling_index, arg_num); |
|
|
tiling_index, arg_num); |
|
|
return ACL_ERROR_GE_INTERNAL_ERROR; |
|
|
return ACL_ERROR_GE_INTERNAL_ERROR; |
|
|
} |
|
|
} |
|
|
arg_base[tiling_index] = reinterpret_cast<uintptr_t>(tiling_buffer); |
|
|
arg_base[tiling_index] = reinterpret_cast<uintptr_t>(tiling_buffer); |
|
|
} |
|
|
} |
|
|
node_ = node; |
|
|
|
|
|
tiling_buffer_ = tiling_buffer; |
|
|
|
|
|
max_tiling_size_ = max_tiling_size; |
|
|
|
|
|
return SUCCESS; |
|
|
return SUCCESS; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|