Browse Source

回退 'Pull Request !1195 : remove ONLY_COMPILE_OPEN_SRC'

pull/1200/head
王涛 Gitee 4 years ago
parent
commit
fc514dd222
4 changed files with 20 additions and 2 deletions
  1. +14
    -0
      ge/graph/load/model_manager/davinci_model.cc
  2. +4
    -0
      ge/graph/passes/cond_remove_pass.cc
  3. +1
    -1
      metadef
  4. +1
    -1
      parser

+ 14
- 0
ge/graph/load/model_manager/davinci_model.cc View File

@@ -3421,6 +3421,7 @@ Status DavinciModel::InitConstant(const OpDescPtr &op_desc) {
elem_num = 1;
}
uint64_t *buff = reinterpret_cast<uint64_t *>(tensor->MutableData().data());
#ifndef ONLY_COMPILE_OPEN_SRC
if (ge::CheckInt64Uint32MulOverflow(elem_num, kBytes * kStringHeadElems) != SUCCESS) {
GELOGE(FAILED, "Shape size is invalid");
return FAILED;
@@ -3432,6 +3433,19 @@ Status DavinciModel::InitConstant(const OpDescPtr &op_desc) {
for (int64_t i = elem_num - 1; i >= 0; --i) {
buff[i * kStringHeadElems] = hbm_raw_data_base_addr + (buff[i * kStringHeadElems] - buff[0]);
}
#else
if (ge::CheckInt64Uint32MulOverflow(elem_num, kBytes) != SUCCESS) {
GELOGE(FAILED, "Shape size is invalid");
return FAILED;
}
uint64_t offset = elem_num * kBytes;

uint64_t hbm_raw_data_base_addr =
static_cast<uint64_t>(reinterpret_cast<uintptr_t>(v_output_addr[0])) + offset;
for (int64_t i = elem_num - 1; i >= 0; --i) {
buff[i] = hbm_raw_data_base_addr + (buff[i] - buff[0]);
}
#endif
}
GELOGI("[IMAS]InitConstant memcpy graph_%u type[V] name[%s] output[%d] memaddr[%p] mem_size[%lu] datasize[%zu]",
runtime_param_.graph_id, op_desc->GetName().c_str(), 0, v_output_addr[0], v_output_size[0],


+ 4
- 0
ge/graph/passes/cond_remove_pass.cc View File

@@ -27,7 +27,11 @@ const uint32_t kFalseIndex = 0;
/// Extra 8 bytes store pointer of string
/// Extra 8 bytes store length of string
/// Extra 1 byte store '\0'
#ifndef ONLY_COMPILE_OPEN_SRC
const int32_t kStrHeadLen = sizeof(ge::StringHead) + 1;
#else
const int32_t kStrHeadLen = 9;
#endif
const int32_t kInvalidRetVal = -1;
}



+ 1
- 1
metadef

@@ -1 +1 @@
Subproject commit 781bdcdff510f62fe1c5ca6b1b18c5a8e15724c4
Subproject commit 711f8dae37dfcc2db259c94edf2803986f12e2e3

+ 1
- 1
parser

@@ -1 +1 @@
Subproject commit 227b10355427038785e95c81a41cda99893eba08
Subproject commit 86162f60807c063f7344f902e443fc99657be637

Loading…
Cancel
Save