Browse Source

Add __attribute__((used)) for global const-variable

pull/1051/head
zhangxiaokun 5 years ago
parent
commit
b06a73ecd6
24 changed files with 317 additions and 318 deletions
  1. +0
    -1
      ge/common/base64.h
  2. +3
    -3
      ge/common/formats/utils/formats_definitions.h
  3. +45
    -45
      ge/common/fp16_t.h
  4. +1
    -1
      ge/common/kernel_store.h
  5. +16
    -16
      ge/common/profiling/profiling_manager.h
  6. +3
    -3
      ge/graph/build/memory/graph_mem_assigner.cc
  7. +1
    -1
      ge/graph/build/memory/mem_assigner.h
  8. +8
    -8
      ge/graph/load/model_manager/aipp_utils.h
  9. +2
    -2
      ge/graph/load/model_manager/davinci_model.h
  10. +14
    -14
      ge/graph/manager/graph_caching_allocator.h
  11. +1
    -1
      ge/graph/manager/graph_manager_utils.h
  12. +9
    -9
      ge/graph/manager/graph_var_manager.h
  13. +2
    -2
      ge/hybrid/node_executor/node_executor.h
  14. +168
    -168
      inc/external/ge/ge_api_types.h
  15. +3
    -3
      inc/external/ge/ge_ir_build.h
  16. +5
    -5
      inc/framework/common/ge_types.h
  17. +3
    -3
      inc/framework/common/l2_cache_optimize.h
  18. +2
    -2
      inc/framework/common/op_types.h
  19. +23
    -23
      inc/framework/common/types.h
  20. +2
    -2
      inc/framework/common/util.h
  21. +1
    -1
      inc/framework/memory/memory_assigner.h
  22. +2
    -2
      third_party/fwkacllib/inc/cce/fwk_adpt_struct.h
  23. +2
    -2
      third_party/fwkacllib/inc/hccl/base.h
  24. +1
    -1
      third_party/fwkacllib/inc/runtime/base.h

+ 0
- 1
ge/common/base64.h View File

@@ -33,7 +33,6 @@ const char kEqualSymbol = '=';
const size_t kBase64CharsNum = 64;
const size_t kThreeByteOneGroup = 3;
const size_t kFourByteOneGroup = 4;
const size_t kThreeByteOneGroupIndex0 = 0;
const size_t kThreeByteOneGroupIndex1 = 1;
const size_t kThreeByteOneGroupIndex2 = 2;
const size_t kFourByteOneGroupIndex0 = 0;


+ 3
- 3
ge/common/formats/utils/formats_definitions.h View File

@@ -19,9 +19,9 @@

namespace ge {
namespace formats {
static const int kCubeSize = 16;
static const int kNiSize = 16;
static const int64_t kShapeItemNumMAX = 1024UL * 1024UL * 1024UL * 1024UL;
static const int kCubeSize __attribute__((used)) = 16;
static const int kNiSize __attribute__((used)) = 16;
static const int64_t kShapeItemNumMAX __attribute__((used)) = 1024UL * 1024UL * 1024UL * 1024UL;


enum NchwDimIndex {


+ 45
- 45
ge/common/fp16_t.h View File

@@ -90,50 +90,50 @@ using BitShift = enum {
};
/// @ingroup fp16 basic parameter
/// @brief fp16 exponent bias
constexpr uint16_t kFp16ExpBias = 15;
constexpr uint16_t kFp16ExpBias __attribute__((used)) = 15;
/// @ingroup fp16 basic parameter
/// @brief the exponent bit length of fp16 is 5
constexpr uint16_t kFp16ExpLen = 5;
constexpr uint16_t kFp16ExpLen __attribute__((used)) = 5;
/// @ingroup fp16 basic parameter
/// @brief the mantissa bit length of fp16 is 10
constexpr uint16_t kFp16ManLen = 10;
constexpr uint16_t kFp16ManLen __attribute__((used)) = 10;
/// @ingroup fp16 basic parameter
/// @brief bit index of sign in fp16
constexpr uint16_t kFp16SignIndex = 15;
constexpr uint16_t kFp16SignIndex __attribute__((used)) = 15;
/// @ingroup fp16 basic parameter
/// @brief sign mask of fp16 (1 00000 00000 00000)
constexpr uint16_t kFp16SignMask = 0x8000;
constexpr uint16_t kFp16SignMask __attribute__((used)) = 0x8000;
/// @ingroup fp16 basic parameter
/// @brief exponent mask of fp16 ( 11111 00000 00000)
constexpr uint16_t kFp16ExpMask = 0x7C00;
constexpr uint16_t kFp16ExpMask __attribute__((used)) = 0x7C00;
/// @ingroup fp16 basic parameter
/// @brief mantissa mask of fp16 ( 11111 11111)
constexpr uint16_t kFp16ManMask = 0x03FF;
constexpr uint16_t kFp16ManMask __attribute__((used)) = 0x03FF;
/// @ingroup fp16 basic parameter
/// @brief hide bit of mantissa of fp16( 1 00000 00000)
constexpr uint16_t kFp16ManHideBit = 0x0400;
constexpr uint16_t kFp16ManHideBit __attribute__((used)) = 0x0400;
/// @ingroup fp16 basic parameter
/// @brief maximum value (0111 1011 1111 1111)
constexpr uint16_t kFp16Max = 0x7BFF;
constexpr uint16_t kFp16Max __attribute__((used)) = 0x7BFF;
/// @ingroup fp16 basic parameter
/// @brief minimum value (1111 1011 1111 1111)
constexpr uint16_t kFp16Min = 0xFBFF;
constexpr uint16_t kFp16Min __attribute__((used)) = 0xFBFF;
/// @ingroup fp16 basic parameter
/// @brief absolute maximum value (0111 1111 1111 1111)
constexpr uint16_t kFp16AbsMax = 0x7FFF;
constexpr uint16_t kFp16AbsMax __attribute__((used)) = 0x7FFF;
/// @ingroup fp16 basic parameter
/// @brief maximum exponent value of fp16 is 15(11111)
constexpr uint16_t kFp16MaxExp = 0x001F;
constexpr uint16_t kFp16MaxExp __attribute__((used)) = 0x001F;
/// @ingroup fp16 basic parameter
/// @brief maximum valid exponent value of fp16 is 14(11110)
constexpr uint16_t kFp16MaxValidExp = 0x001E;
constexpr uint16_t kFp16MaxValidExp __attribute__((used)) = 0x001E;
/// @ingroup fp16 basic parameter
/// @brief maximum mantissa value of fp16(11111 11111)
constexpr uint16_t kFp16MaxMan = 0x03FF;
constexpr uint16_t kFp16MaxMan __attribute__((used)) = 0x03FF;
/// @ingroup fp16 basic parameter
/// @brief absolute minimum normal value of fp16
/// (E=1,M=0 D=2^(-14)=0.00006103515625)
constexpr uint16_t kFp16MinNormal = 1.0f / (2 << 14);
constexpr uint16_t kFp16MinNormal __attribute__((used)) = 1.0f / (2 << 14);
/// @ingroup fp16 basic operator
/// @brief get sign of fp16
#define FP16_EXTRAC_SIGN(x) (((x) >> 15) & 1)
@@ -163,37 +163,37 @@ constexpr uint16_t kFp16MinNormal = 1.0f / (2 << 14);
#define FP16_IS_INVALID(x) ((x & kFp16ExpMask) == kFp16ExpMask)
/// @ingroup fp32 basic parameter
/// @brief fp32 exponent bias
constexpr uint16_t kFp32ExpBias = 127;
constexpr uint16_t kFp32ExpBias __attribute__((used)) = 127;
/// @ingroup fp32 basic parameter
/// @brief the exponent bit length of float/fp32 is 8
constexpr uint16_t kFp32ExpLen = 8;
constexpr uint16_t kFp32ExpLen __attribute__((used)) = 8;
/// @ingroup fp32 basic parameter
/// @brief the mantissa bit length of float/fp32 is 23
constexpr uint16_t kFp32ManLen = 23;
constexpr uint16_t kFp32ManLen __attribute__((used)) = 23;
/// @ingroup fp32 basic parameter
/// @brief bit index of sign in float/fp32
constexpr uint16_t kFp32SignIndex = 31;
constexpr uint16_t kFp32SignIndex __attribute__((used)) = 31;
/// @ingroup fp32 basic parameter
/// @brief sign mask of fp32 (1 0000 0000 0000 0000 0000 0000 000)
constexpr uint32_t kFp32SignMask = 0x80000000u;
constexpr uint32_t kFp32SignMask __attribute__((used)) = 0x80000000u;
/// @ingroup fp32 basic parameter
/// @brief exponent mask of fp32 ( 1111 1111 0000 0000 0000 0000 000)
constexpr uint32_t kFp32ExpMask = 0x7F800000u;
constexpr uint32_t kFp32ExpMask __attribute__((used)) = 0x7F800000u;
/// @ingroup fp32 basic parameter
/// @brief mantissa mask of fp32 ( 1111 1111 1111 1111 111)
constexpr uint32_t kFp32ManMask = 0x007FFFFFu;
constexpr uint32_t kFp32ManMask __attribute__((used)) = 0x007FFFFFu;
/// @ingroup fp32 basic parameter
/// @brief hide bit of mantissa of fp32 ( 1 0000 0000 0000 0000 000)
constexpr uint32_t kFp32ManHideBit = 0x00800000u;
constexpr uint32_t kFp32ManHideBit __attribute__((used)) = 0x00800000u;
/// @ingroup fp32 basic parameter
/// @brief absolute maximum value (0 1111 1111 1111 1111 1111 1111 111)
constexpr uint32_t kFp32AbsMax = 0x7FFFFFFFu;
constexpr uint32_t kFp32AbsMax __attribute__((used)) = 0x7FFFFFFFu;
/// @ingroup fp32 basic parameter
/// @brief maximum exponent value of fp32 is 255(1111 1111)
constexpr uint32_t kFp32MaxExp = 0xFF;
constexpr uint32_t kFp32MaxExp __attribute__((used)) = 0xFF;
/// @ingroup fp32 basic parameter
/// @brief maximum mantissa value of fp32 (1111 1111 1111 1111 1111 111)
constexpr uint32_t kFp32MaxMan = 0x7FFFFF;
constexpr uint32_t kFp32MaxMan __attribute__((used)) = 0x7FFFFF;
/// @ingroup fp32 special value judgment
/// @brief whether a fp32 is NaN
#define FP32_IS_NAN(x) (((x & kFp32ExpMask) == kFp32ExpMask) && (x & kFp32ManMask))
@@ -217,37 +217,37 @@ constexpr uint32_t kFp32MaxMan = 0x7FFFFF;
#define FP32_CONSTRUCTOR(s, e, m) (((s) << kFp32SignIndex) | ((e) << kFp32ManLen) | ((m)&kFp32MaxMan))
/// @ingroup fp64 basic parameter
/// @brief fp64 exponent bias
constexpr uint16_t kFp64ExpBias = 1023;
constexpr uint16_t kFp64ExpBias __attribute__((used)) = 1023;
/// @ingroup fp64 basic parameter
/// @brief the exponent bit length of double/fp64 is 11
constexpr uint16_t kFp64ExpLen = 11;
constexpr uint16_t kFp64ExpLen __attribute__((used)) = 11;
/// @ingroup fp64 basic parameter
/// @brief the mantissa bit length of double/fp64 is 52
constexpr uint16_t kFp64ManLen = 52;
constexpr uint16_t kFp64ManLen __attribute__((used)) = 52;
/// @ingroup fp64 basic parameter
/// @brief bit index of sign in double/fp64 is 63
constexpr uint16_t kFp64SignIndex = 63;
constexpr uint16_t kFp64SignIndex __attribute__((used)) = 63;
/// @ingroup fp64 basic parameter
/// @brief sign mask of fp64 (1 000 (total 63bits 0))
constexpr uint64_t kFp64SignMask = 0x8000000000000000LLu;
constexpr uint64_t kFp64SignMask __attribute__((used)) = 0x8000000000000000LLu;
/// @ingroup fp64 basic parameter
/// @brief exponent mask of fp64 (0 1 11111 11111 0000?-?-(total 52bits 0))
constexpr uint64_t kFp64ExpMask = 0x7FF0000000000000LLu;
constexpr uint64_t kFp64ExpMask __attribute__((used)) = 0x7FF0000000000000LLu;
/// @ingroup fp64 basic parameter
/// @brief mantissa mask of fp64 ( 1111?-?-(total 52bits 1))
constexpr uint64_t kFp64ManMask = 0x000FFFFFFFFFFFFFLLu;
constexpr uint64_t kFp64ManMask __attribute__((used)) = 0x000FFFFFFFFFFFFFLLu;
/// @ingroup fp64 basic parameter
/// @brief hide bit of mantissa of fp64 ( 1 0000?-?-(total 52bits 0))
constexpr uint64_t kFp64ManHideBit = 0x0010000000000000LLu;
constexpr uint64_t kFp64ManHideBit __attribute__((used)) = 0x0010000000000000LLu;
/// @ingroup fp64 basic parameter
/// @brief absolute maximum value (0 111?-?-(total 63bits 1))
constexpr uint64_t kFp64AbsMax = 0x7FFFFFFFFFFFFFFFLLu;
constexpr uint64_t kFp64AbsMax __attribute__((used)) = 0x7FFFFFFFFFFFFFFFLLu;
/// @ingroup fp64 basic parameter
/// @brief maximum exponent value of fp64 is 2047(1 11111 11111)
constexpr uint64_t kFp64MaxExp = 0x07FF;
constexpr uint64_t kFp64MaxExp __attribute__((used)) = 0x07FF;
/// @ingroup fp64 basic parameter
/// @brief maximum mantissa value of fp64 (111?-?-(total 52bits 1))
constexpr uint64_t kFp64MaxMan = 0xFFFFFFFFFFFLLu;
constexpr uint64_t kFp64MaxMan __attribute__((used)) = 0xFFFFFFFFFFFLLu;
/// @ingroup fp64 special value judgment
/// @brief whether a fp64 is NaN
#define FP64_IS_NAN(x) (((x & kFp64ExpMask) == kFp64ExpMask) && (x & kFp64ManMask))
@@ -256,30 +256,30 @@ constexpr uint64_t kFp64MaxMan = 0xFFFFFFFFFFFLLu;
#define FP64_IS_INF(x) (((x & kFp64ExpMask) == kFp64ExpMask) && (!(x & kFp64ManMask)))
/// @ingroup integer special value judgment
/// @brief maximum positive value of int8_t (0111 1111)
constexpr int8_t kInt8Max = 0x7F;
constexpr int8_t kInt8Max __attribute__((used)) = 0x7F;
/// @ingroup integer special value judgment
/// @brief maximum value of a data with 8 bits length (1111 111)
constexpr uint8_t kBitLen8Max = 0xFF;
constexpr uint8_t kBitLen8Max __attribute__((used)) = 0xFF;
/// @ingroup integer special value judgment
/// @brief maximum positive value of int16_t (0111 1111 1111 1111)
constexpr int16_t kInt16Max = 0x7FFF;
constexpr int16_t kInt16Max __attribute__((used)) = 0x7FFF;
/// @ingroup integer special value judgment
/// @brief maximum value of a data with 16 bits length (1111 1111 1111 1111)
constexpr uint16_t kBitLen16Max = 0xFFFF;
constexpr uint16_t kBitLen16Max __attribute__((used)) = 0xFFFF;
/// @ingroup integer special value judgment
/// @brief maximum positive value of int32_t (0111 1111 1111 1111 1111 1111 1111 1111)
constexpr int32_t kInt32Max = 0x7FFFFFFFu;
constexpr int32_t kInt32Max __attribute__((used)) = 0x7FFFFFFFu;
/// @ingroup integer special value judgment
/// @brief maximum value of a data with 32 bits length (1111 1111 1111 1111 1111 1111 1111 1111)
constexpr uint32_t kBitLen32Max = 0xFFFFFFFFu;
constexpr uint32_t kBitLen32Max __attribute__((used)) = 0xFFFFFFFFu;
/// @ingroup integer special value judgment
/// @brief maximum positive value of int64_t
/// (0111 1111 1111 1111 1111 1111 1111 1111 1111 1111 1111 1111 1111 1111 1111 1111)
constexpr int64_t kInt64Max = 0x7FFFFFFFFFFFFFFFu;
constexpr int64_t kInt64Max __attribute__((used)) = 0x7FFFFFFFFFFFFFFFu;
/// @ingroup integer special value judgment
/// @brief maximum value of a data with 64 bits length
/// (1111 1111 1111 1111 1111 1111 1111 1111 1111 1111 1111 1111 1111 1111 1111 1111)
constexpr uint64_t kBitLen64Max = 0xFFFFFFFFFFFFFFFFu;
constexpr uint64_t kBitLen64Max __attribute__((used)) = 0xFFFFFFFFFFFFFFFFu;

/// @ingroup fp16_t enum
/// @brief round mode of last valid digital


+ 1
- 1
ge/common/kernel_store.h View File

@@ -40,7 +40,7 @@ using CustAICPUKernelPtr = std::shared_ptr<ge::OpKernelBin>;
using TBEKernel = ge::OpKernelBin;
using TBEKernelPtr = std::shared_ptr<ge::OpKernelBin>;

const uint32_t kKernelItemMagic = 0x5d776efd;
const uint32_t kKernelItemMagic __attribute__((used)) = 0x5d776efd;

struct KernelStoreItemHead {
uint32_t magic;


+ 16
- 16
ge/common/profiling/profiling_manager.h View File

@@ -34,23 +34,23 @@ using std::vector;
using Json = nlohmann::json;

namespace {
const std::string GE_PROFILING_MODULE = "Framework";
const std::string GE_PROFILING_MODULE __attribute__((used)) = "Framework";
// DataTypeConfig MASK
const uint64_t PROF_ACL_API_MASK = 0x0001;
const uint64_t PROF_TASK_TIME_MASK = 0x0002;
const uint64_t PROF_AICORE_METRICS_MASK = 0x0004;
const uint64_t PROF_AICPU_TRACE_MASK = 0x0008;
const uint64_t PROF_MODEL_EXECUTE_MASK = 0x0010;
const uint64_t PROF_RUNTIME_API_MASK = 0x0020;
const uint64_t PROF_RUNTIME_TRACE_MASK = 0x0040;
const uint64_t PROF_SCHEDULE_TIMELINE_MASK = 0x0080;
const uint64_t PROF_SCHEDULE_TRACE_MASK = 0x0100;
const uint64_t PROF_AIVECTORCORE_METRICS_MASK = 0x0200;
const uint64_t PROF_SUBTASK_TIME_MASK = 0x0400;
const uint64_t PROF_TRAINING_TRACE_MASK = 0x0800;
const uint64_t PROF_HCCL_TRACE_MASK = 0x1000;
const uint64_t PROF_DATA_PROCESS_MASK = 0x2000;
const uint64_t PROF_MODEL_LOAD_MASK = 0x8000000000000000;
const uint64_t PROF_ACL_API_MASK __attribute__((used)) = 0x0001;
const uint64_t PROF_TASK_TIME_MASK __attribute__((used)) = 0x0002;
const uint64_t PROF_AICORE_METRICS_MASK __attribute__((used)) = 0x0004;
const uint64_t PROF_AICPU_TRACE_MASK __attribute__((used)) = 0x0008;
const uint64_t PROF_MODEL_EXECUTE_MASK __attribute__((used)) = 0x0010;
const uint64_t PROF_RUNTIME_API_MASK __attribute__((used)) = 0x0020;
const uint64_t PROF_RUNTIME_TRACE_MASK __attribute__((used)) = 0x0040;
const uint64_t PROF_SCHEDULE_TIMELINE_MASK __attribute__((used)) = 0x0080;
const uint64_t PROF_SCHEDULE_TRACE_MASK __attribute__((used)) = 0x0100;
const uint64_t PROF_AIVECTORCORE_METRICS_MASK __attribute__((used)) = 0x0200;
const uint64_t PROF_SUBTASK_TIME_MASK __attribute__((used)) = 0x0400;
const uint64_t PROF_TRAINING_TRACE_MASK __attribute__((used)) = 0x0800;
const uint64_t PROF_HCCL_TRACE_MASK __attribute__((used)) = 0x1000;
const uint64_t PROF_DATA_PROCESS_MASK __attribute__((used)) = 0x2000;
const uint64_t PROF_MODEL_LOAD_MASK __attribute__((used)) = 0x8000000000000000;

} // namespace
namespace ge {


+ 3
- 3
ge/graph/build/memory/graph_mem_assigner.cc View File

@@ -948,7 +948,7 @@ Status GraphMemoryAssigner::AssignAtomicOutputMemory(const ge::NodePtr &node, ve
output_list[output_index] = iter->second.mem_offset_;
std::string batch_label;
(void)ge::AttrUtils::GetStr(op_desc, ATTR_NAME_BATCH_LABEL, batch_label);
GELOGI("[IMAS]Atomic output : Set %s name[%s] optype[%s] output[%ld] offset to [%zu] stream_id[%ld] memtype[%ld] "
GELOGI("[IMAS]Atomic output : Set %s name[%s] optype[%s] output[%ld] offset to [%zu] stream_id[%ld] memtype[%u] "
"size[%ld] real_size[%ld] batch[%s].", compute_graph_->GetName().c_str(), op_desc->GetName().c_str(),
node->GetType().c_str(), output_index, iter->second.mem_offset_, op_desc->GetStreamId(), RT_MEMORY_HBM,
size, size, batch_label.c_str());
@@ -1028,7 +1028,7 @@ Status GraphMemoryAssigner::AssignOrdinaryAtomicWorkspaceMemory(const ge::OpDesc
(void)ge::AttrUtils::GetStr(op_desc, ATTR_NAME_BATCH_LABEL, batch_label);
GELOGI(
"[IMAS]Atomic ordinary workspace : Set %s name[%s] optype[%s] workspace[%lu] offset to [%zu] stream_id[%ld] "
"memtype[%ld] size[%ld] real_size[%ld] batch[%s].",
"memtype[%u] size[%ld] real_size[%ld] batch[%s].",
compute_graph_->GetName().c_str(), op_desc->GetName().c_str(), op_desc->GetType().c_str(), workspace_index,
mem_type_iter->second.mem_offset_, op_desc->GetStreamId(), RT_MEMORY_HBM, workspace_size, workspace_size,
batch_label.c_str());
@@ -1069,7 +1069,7 @@ Status GraphMemoryAssigner::AssignFusionAtomicWorkspaceMemory(const ge::OpDescPt
(void)ge::AttrUtils::GetStr(op_desc, ATTR_NAME_BATCH_LABEL, batch_label);
GELOGI(
"[IMAS]Atomic fusion workspace : Set %s name[%s] optype[%s] workspace[%lu] offset to [%zu] stream_id[%ld] "
"memtype[%ld] ssize[%ld] real_size[%ld] batch[%s].", compute_graph_->GetName().c_str(),
"memtype[%u] ssize[%ld] real_size[%ld] batch[%s].", compute_graph_->GetName().c_str(),
op_desc->GetName().c_str(), op_desc->GetType().c_str(), workspace_index, mem_type_iter->second.mem_offset_,
op_desc->GetStreamId(), RT_MEMORY_HBM, workspace_size, workspace_size, batch_label.c_str());



+ 1
- 1
ge/graph/build/memory/mem_assigner.h View File

@@ -20,7 +20,7 @@
#include "common/ge_inner_error_codes.h"
#include "memory/memory_assigner.h"
namespace ge {
static const int64_t kInvalidOffset = -1;
static const int64_t kInvalidOffset __attribute__((used)) = -1;

class MemAssigner {
public:


+ 8
- 8
ge/graph/load/model_manager/aipp_utils.h View File

@@ -27,14 +27,14 @@
using std::vector;

namespace ge {
const uint32_t kAippOriginInputIndex = 0;
const uint32_t kAippInfoNum = 6;
const uint32_t kAippInfoFormat = 0;
const uint32_t kAippInfoDataType = 1;
const uint32_t kAippInfoTensorName = 2;
const uint32_t kAippInfoTensorSize = 3;
const uint32_t kAippInfoDimNum = 4;
const uint32_t kAippInfoShape = 5;
const uint32_t kAippOriginInputIndex __attribute__((used)) = 0;
const uint32_t kAippInfoNum __attribute__((used)) = 6;
const uint32_t kAippInfoFormat __attribute__((used)) = 0;
const uint32_t kAippInfoDataType __attribute__((used)) = 1;
const uint32_t kAippInfoTensorName __attribute__((used)) = 2;
const uint32_t kAippInfoTensorSize __attribute__((used)) = 3;
const uint32_t kAippInfoDimNum __attribute__((used)) = 4;
const uint32_t kAippInfoShape __attribute__((used)) = 5;

class AippUtils {
public:


+ 2
- 2
ge/graph/load/model_manager/davinci_model.h View File

@@ -55,8 +55,8 @@ using std::multimap;

namespace ge {
// op debug need 2048 bits buffer
const size_t kOpDebugMemorySize = 2048UL;
const size_t kDebugP2pSize = 8UL;
const size_t kOpDebugMemorySize __attribute__((used)) = 2048UL;
const size_t kDebugP2pSize __attribute__((used)) = 8UL;

typedef enum tagModelProcStage {
MODEL_LOAD_START = 1,


+ 14
- 14
ge/graph/manager/graph_caching_allocator.h View File

@@ -33,20 +33,20 @@
#include "runtime/mem.h"

namespace ge {
constexpr size_t kRoundBlockSize = 512; // all block sizes are rounded to at least 512 bytes
constexpr size_t kBinSizeUnit4 = 4;
constexpr size_t kBinSizeUnit8 = 8;
constexpr size_t kBinSizeUnit16 = 16;
constexpr size_t kBinSizeUnit26 = 26;
constexpr size_t kBinSizeUnit32 = 32;
constexpr size_t kBinSizeUnit128 = 128;
constexpr double kSplitThreshold = 0.75; // split when malloc size <= small block size * kSpliThreshold
constexpr size_t kKByteSize = 1024;
constexpr size_t kMByteSize = 1048576; // 1024 * 1024
constexpr size_t kGByteSize = 1073741824; // 1024 * 1024 * 1024
static const uint32_t kNumBins = 8;
constexpr size_t kRoundBlockSize __attribute__((used)) = 512; // all block sizes are rounded to at least 512 bytes
constexpr size_t kBinSizeUnit4 __attribute__((used)) = 4;
constexpr size_t kBinSizeUnit8 __attribute__((used)) = 8;
constexpr size_t kBinSizeUnit16 __attribute__((used)) = 16;
constexpr size_t kBinSizeUnit26 __attribute__((used)) = 26;
constexpr size_t kBinSizeUnit32 __attribute__((used)) = 32;
constexpr size_t kBinSizeUnit128 __attribute__((used)) = 128;
constexpr double kSplitThreshold __attribute__((used)) = 0.75; // split when size <= small block size * kSpliThreshold
constexpr size_t kKByteSize __attribute__((used)) = 1024;
constexpr size_t kMByteSize __attribute__((used)) = 1048576; // 1024 * 1024
constexpr size_t kGByteSize __attribute__((used)) = 1073741824; // 1024 * 1024 * 1024
static const uint32_t kNumBins __attribute__((used)) = 8;

class MemoryAllocator;



+ 1
- 1
ge/graph/manager/graph_manager_utils.h View File

@@ -54,7 +54,7 @@ using GeModelPtr = std::shared_ptr<ge::GeModel>;
using ConstGraphPtr = std::shared_ptr<const ge::Graph>;
using GraphPtr = std::shared_ptr<ge::Graph>;

const uint64_t INVALID_SESSION_ID = 0xffffffffffffffffULL;
const uint64_t INVALID_SESSION_ID __attribute__((used)) = 0xffffffffffffffffULL;

struct ModelIdInfo {
uint32_t model_id{INVALID_MODEL_ID};


+ 9
- 9
ge/graph/manager/graph_var_manager.h View File

@@ -34,15 +34,15 @@
#include "runtime/mem.h"

namespace ge {
const size_t kGraphMemoryManagerMallocMaxSize = 26UL * 1024UL * 1024UL * 1024UL;
const size_t kMemoryVarManagerMallocSize = 5UL * 1024UL * 1024UL * 1024UL;
const size_t kMemoryVarLogicBase = 32UL * 1024UL * 1024UL * 1024UL;
const size_t kUseMaxMemorySize = kGraphMemoryManagerMallocMaxSize + kMemoryVarManagerMallocSize;
const size_t kGraphMemoryBuffer = 4UL * 1024UL * 1024UL * 1024UL;
const size_t kMaxMemorySize = 256UL * 1024UL * 1024UL * 1024UL;
const char kEnvGeuseStaticMemory[] = "GE_USE_STATIC_MEMORY";
const uint64_t kSessionMemAlignSize = 512;
const size_t kSessionMemAlignUnit = 2;
const size_t kGraphMemoryManagerMallocMaxSize __attribute__((used)) = 26UL * 1024UL * 1024UL * 1024UL;
const size_t kMemoryVarManagerMallocSize __attribute__((used)) = 5UL * 1024UL * 1024UL * 1024UL;
const size_t kMemoryVarLogicBase __attribute__((used)) = 32UL * 1024UL * 1024UL * 1024UL;
const size_t kUseMaxMemorySize __attribute__((used)) = kGraphMemoryManagerMallocMaxSize + kMemoryVarManagerMallocSize;
const size_t kGraphMemoryBuffer __attribute__((used)) = 4UL * 1024UL * 1024UL * 1024UL;
const size_t kMaxMemorySize __attribute__((used)) = 256UL * 1024UL * 1024UL * 1024UL;
const char kEnvGeuseStaticMemory[] __attribute__((used)) = "GE_USE_STATIC_MEMORY";
const uint64_t kSessionMemAlignSize __attribute__((used)) = 512;
const size_t kSessionMemAlignUnit __attribute__((used)) = 2;

enum MemStatus {
NORMAL = 0,


+ 2
- 2
ge/hybrid/node_executor/node_executor.h View File

@@ -23,8 +23,8 @@
#include "task_context.h"

namespace ge {
const uint32_t MEMORY_ALIGN_RATIO = 2;
const uint32_t MEMORY_ALIGN_SIZE = 32;
const uint32_t MEMORY_ALIGN_RATIO __attribute__((used)) = 2;
const uint32_t MEMORY_ALIGN_SIZE __attribute__((used)) = 32;
namespace hybrid {
class HybridModel;
// Base class of Node Task


+ 168
- 168
inc/external/ge/ge_api_types.h View File

@@ -26,287 +26,287 @@

namespace ge {
// Option key: graph run mode
const char *const OPTION_GRAPH_RUN_MODE = "ge.graphRunMode";
const char *const OPTION_GRAPH_RUN_MODE __attribute__((used)) = "ge.graphRunMode";

// Option key: ome init
const char *const OPTION_EXEC_SESSION_ID = "ge.exec.sessionId";
const char *const OPTION_EXEC_DEVICE_ID = "ge.exec.deviceId";
const char *const OPTION_EXEC_JOB_ID = "ge.exec.jobId";
const char *const OPTION_EXEC_IS_USEHCOM = "ge.exec.isUseHcom";
const char *const OPTION_EXEC_IS_USEHVD = "ge.exec.isUseHvd";
const char *const OPTION_EXEC_RANK_ID = "ge.exec.rankId";
const char *const OPTION_EXEC_POD_NAME = "ge.exec.podName";
const char *const OPTION_EXEC_DEPLOY_MODE = "ge.exec.deployMode";
const char *const OPTION_EXEC_RANK_TABLE_FILE = "ge.exec.rankTableFile";
const char *const GE_AICPU_FLAG = "ge.aicpuFlag";
const char *const OPTION_EXEC_EXTERN_PLUGIN_PATH = "ge.soLoadPath";
const char *const OPTION_EXEC_SESSION_ID __attribute__((used)) = "ge.exec.sessionId";
const char *const OPTION_EXEC_DEVICE_ID __attribute__((used)) = "ge.exec.deviceId";
const char *const OPTION_EXEC_JOB_ID __attribute__((used)) = "ge.exec.jobId";
const char *const OPTION_EXEC_IS_USEHCOM __attribute__((used)) = "ge.exec.isUseHcom";
const char *const OPTION_EXEC_IS_USEHVD __attribute__((used)) = "ge.exec.isUseHvd";
const char *const OPTION_EXEC_RANK_ID __attribute__((used)) = "ge.exec.rankId";
const char *const OPTION_EXEC_POD_NAME __attribute__((used)) = "ge.exec.podName";
const char *const OPTION_EXEC_DEPLOY_MODE __attribute__((used)) = "ge.exec.deployMode";
const char *const OPTION_EXEC_RANK_TABLE_FILE __attribute__((used)) = "ge.exec.rankTableFile";
const char *const GE_AICPU_FLAG __attribute__((used)) = "ge.aicpuFlag";
const char *const OPTION_EXEC_EXTERN_PLUGIN_PATH __attribute__((used)) = "ge.soLoadPath";
// Dump flag and para
const char *const OPTION_EXEC_ENABLE_DUMP = "ge.exec.enableDump";
const char *const OPTION_EXEC_DUMP_PATH = "ge.exec.dumpPath";
const char *const OPTION_EXEC_DUMP_STEP = "ge.exec.dumpStep";
const char *const OPTION_EXEC_DUMP_MODE = "ge.exec.dumpMode";
const char *const OPTION_EXEC_ENABLE_DUMP_DEBUG = "ge.exec.enableDumpDebug";
const char *const OPTION_EXEC_DUMP_DEBUG_MODE = "ge.exec.dumpDebugMode";
const char *const OPTION_EXEC_ENABLE_INCRE_BUILD = "ge.exec.enableIncreBuild";
const char *const OPTION_EXEC_INCRE_BUILD_CACHE_PATH = "ge.exec.increBuildCachePath";
const char *const OPTION_EXEC_ENABLE_EXCEPTION_DUMP = "ge.exec.enable_exception_dump";
const char *const OPTION_EXEC_ENABLE_SCOPE_FUSION_PASSES = "ge.exec.enableScopeFusionPasses";
const char *const OPTION_EXEC_PROFILING_FPPONIT_OPTIONS = "ge.exec.profilingFpPointOptions";
const char *const OPTION_EXEC_PROFILING_BPPONIT_OPTIONS = "ge.exec.profilingBpPointOptions";
const char *const OPTION_EXEC_ENABLE_DUMP __attribute__((used)) = "ge.exec.enableDump";
const char *const OPTION_EXEC_DUMP_PATH __attribute__((used)) = "ge.exec.dumpPath";
const char *const OPTION_EXEC_DUMP_STEP __attribute__((used)) = "ge.exec.dumpStep";
const char *const OPTION_EXEC_DUMP_MODE __attribute__((used)) = "ge.exec.dumpMode";
const char *const OPTION_EXEC_ENABLE_DUMP_DEBUG __attribute__((used)) = "ge.exec.enableDumpDebug";
const char *const OPTION_EXEC_DUMP_DEBUG_MODE __attribute__((used)) = "ge.exec.dumpDebugMode";
const char *const OPTION_EXEC_ENABLE_INCRE_BUILD __attribute__((used)) = "ge.exec.enableIncreBuild";
const char *const OPTION_EXEC_INCRE_BUILD_CACHE_PATH __attribute__((used)) = "ge.exec.increBuildCachePath";
const char *const OPTION_EXEC_ENABLE_EXCEPTION_DUMP __attribute__((used)) = "ge.exec.enable_exception_dump";
const char *const OPTION_EXEC_ENABLE_SCOPE_FUSION_PASSES __attribute__((used)) = "ge.exec.enableScopeFusionPasses";
const char *const OPTION_EXEC_PROFILING_FPPONIT_OPTIONS __attribute__((used)) = "ge.exec.profilingFpPointOptions";
const char *const OPTION_EXEC_PROFILING_BPPONIT_OPTIONS __attribute__((used)) = "ge.exec.profilingBpPointOptions";
// profiling flag
const char *const OPTION_EXEC_PROFILING_MODE = "ge.exec.profilingMode";
const char *const OPTION_EXEC_PROFILING_OPTIONS = "ge.exec.profilingOptions";
const char *const OPTION_EXEC_PROFILING_MODE __attribute__((used)) = "ge.exec.profilingMode";
const char *const OPTION_EXEC_PROFILING_OPTIONS __attribute__((used)) = "ge.exec.profilingOptions";
// Hccl flag, if ge.exec.hcclFlag =1, it means load plugin for opskernel, else:ge.exec.hcclFlag =0
const char *const OPTION_EXEC_HCCL_FLAG = "ge.exec.hcclFlag";
const char *const OPTION_EXEC_ATOMIC_FLAG = "ge.exec.enable_atomic";
const char *const OPTION_EXEC_DISABLE_REUSED_MEMORY = "ge.exec.disableReuseMemory";
const char *const OPTION_EXEC_ENABLE_TAILING_OPTIMIZATION = "ge.exec.isTailingOptimization";
const char *const OPTION_EXEC_HCCL_FLAG __attribute__((used)) = "ge.exec.hcclFlag";
const char *const OPTION_EXEC_ATOMIC_FLAG __attribute__((used)) = "ge.exec.enable_atomic";
const char *const OPTION_EXEC_DISABLE_REUSED_MEMORY __attribute__((used)) = "ge.exec.disableReuseMemory";
const char *const OPTION_EXEC_ENABLE_TAILING_OPTIMIZATION __attribute__((used)) = "ge.exec.isTailingOptimization";
// Dynamic input flag. ge.exec.dynamicInput=1, means enable dynaimc input,
// ge.exec.dynamicGraphExecuteMode, dynamic_execute[default]
const char *const OPTION_EXEC_DYNAMIC_INPUT = "ge.exec.dynamicInput";
const char *const OPTION_EXEC_DYNAMIC_EXECUTE_MODE = "ge.exec.dynamicGraphExecuteMode";
const char *const OPTION_EXEC_DATA_INPUTS_SHAPE_RANGE = "ge.exec.dataInputsShapeRange";
const char *const OPTION_EXEC_DYNAMIC_INPUT __attribute__((used)) = "ge.exec.dynamicInput";
const char *const OPTION_EXEC_DYNAMIC_EXECUTE_MODE __attribute__((used)) = "ge.exec.dynamicGraphExecuteMode";
const char *const OPTION_EXEC_DATA_INPUTS_SHAPE_RANGE __attribute__((used)) = "ge.exec.dataInputsShapeRange";

// Option key: memory init
const char *const GRAPH_MEMORY_MAX_SIZE = "ge.graphMemoryMaxSize";
const char *const VARIABLE_MEMORY_MAX_SIZE = "ge.variableMemoryMaxSize";
const char *const GRAPH_MEMORY_MAX_SIZE __attribute__((used)) = "ge.graphMemoryMaxSize";
const char *const VARIABLE_MEMORY_MAX_SIZE __attribute__((used)) = "ge.variableMemoryMaxSize";
namespace configure_option {
const char *const STREAM_NUM = "ge.streamNum";
const char *const HEAD_STREAM = "ge.headStream";
const char *const PERF_LEVEL = "ge.perfLevel";
const char *const ENCRYPT_MODE = "ge.encryptMode";
const char *const EK_FILE = "ge.ekFile";
const char *const CERT_FILE = "ge.certFile";
const char *const HW_KEY_FILE = "ge.hwKeyFile";
const char *const PRIVATE_KEY_FILE = "ge.privateKeyFile";
const char *const FRAMEWORK_TYPE = "ge.frameworkType";
const char *const CALIBRATION_CONF_FILE = "ge.calibrationConfFile";
const char *const INSERT_OP_FILE = "ge.insertOpFile";
const char *const OUTPUT_NODE_NAME = "ge.outputNodeName";
const char *const COMPRESS_FLAG = "ge.compressFlag";
const char *const PRECISION_MODE = "ge.exec.precision_mode";
const char *const SINGLE_OP_FLAG = "ge.exec.single_op";
const char *const TRAIN_FLAG = "ge.trainFlag";
const char *const RUN_FLAG = "ge.runFlag";
const char *const LOCAL_FMKOP_FLAG = "ge.enabledLocalFmkop";
const char *const TBE_PLUGIN_PATH_FLAG = "ge.TBE_plugin_path";
const char *const DDK_VERSION_FLAG = "ge.DDK_version";
const char *const GE_FE_FLAG = "ge.feFlag";
const char *const STREAM_MAX_PARALLEL_NUM = "ge.streamMaxParallelNum";
const char *const OUTPUT_DATATYPE = "ge.outputDatatype";
const char *const OP_SELECT_IMPL_MODE = "ge.opSelectImplmode";
const char *const OPTYPELIST_FOR_IMPLMODE = "ge.optypelistForImplmode";
const char *const HCOM_PARALLEL = "ge.hcomParallel";
const char *const AUTO_TUNE_MODE = "ge.autoTuneMode";
const char *const SOC_VERSION = "ge.socVersion";
const char *const CORE_TYPE = "ge.engineType";
const char *const AICORE_NUM = "ge.aicoreNum";
const char *const L1_FUSION = "ge.l1Fusion";
const char *const BUFFER_OPTIMIZE = "ge.bufferOptimize";
const char *const ENABLE_SMALL_CHANNEL = "ge.enableSmallChannel";
const char *const ENABLE_COMPRESS_WEIGHT = "ge.enableCompressWeight";
const char *const FUSION_SWITCH_FILE = "ge.fusionSwitchFile";
const char *const SAVE_ORIGINAL_MODEL = "ge.saveOriginalModel";
const char *const ORIGINAL_MODEL_FILE = "ge.originalModelFile";
const char *const INPUT_FP16_NODES = "ge.INPUT_NODES_SET_FP16";
const char *const OP_DEBUG_LEVEL = "ge.opDebugLevel";
const char *const STREAM_NUM __attribute__((used)) = "ge.streamNum";
const char *const HEAD_STREAM __attribute__((used)) = "ge.headStream";
const char *const PERF_LEVEL __attribute__((used)) = "ge.perfLevel";
const char *const ENCRYPT_MODE __attribute__((used)) = "ge.encryptMode";
const char *const EK_FILE __attribute__((used)) = "ge.ekFile";
const char *const CERT_FILE __attribute__((used)) = "ge.certFile";
const char *const HW_KEY_FILE __attribute__((used)) = "ge.hwKeyFile";
const char *const PRIVATE_KEY_FILE __attribute__((used)) = "ge.privateKeyFile";
const char *const FRAMEWORK_TYPE __attribute__((used)) = "ge.frameworkType";
const char *const CALIBRATION_CONF_FILE __attribute__((used)) = "ge.calibrationConfFile";
const char *const INSERT_OP_FILE __attribute__((used)) = "ge.insertOpFile";
const char *const OUTPUT_NODE_NAME __attribute__((used)) = "ge.outputNodeName";
const char *const COMPRESS_FLAG __attribute__((used)) = "ge.compressFlag";
const char *const PRECISION_MODE __attribute__((used)) = "ge.exec.precision_mode";
const char *const SINGLE_OP_FLAG __attribute__((used)) = "ge.exec.single_op";
const char *const TRAIN_FLAG __attribute__((used)) = "ge.trainFlag";
const char *const RUN_FLAG __attribute__((used)) = "ge.runFlag";
const char *const LOCAL_FMKOP_FLAG __attribute__((used)) = "ge.enabledLocalFmkop";
const char *const TBE_PLUGIN_PATH_FLAG __attribute__((used)) = "ge.TBE_plugin_path";
const char *const DDK_VERSION_FLAG __attribute__((used)) = "ge.DDK_version";
const char *const GE_FE_FLAG __attribute__((used)) = "ge.feFlag";
const char *const STREAM_MAX_PARALLEL_NUM __attribute__((used)) = "ge.streamMaxParallelNum";
const char *const OUTPUT_DATATYPE __attribute__((used)) = "ge.outputDatatype";
const char *const OP_SELECT_IMPL_MODE __attribute__((used)) = "ge.opSelectImplmode";
const char *const OPTYPELIST_FOR_IMPLMODE __attribute__((used)) = "ge.optypelistForImplmode";
const char *const HCOM_PARALLEL __attribute__((used)) = "ge.hcomParallel";
const char *const AUTO_TUNE_MODE __attribute__((used)) = "ge.autoTuneMode";
const char *const SOC_VERSION __attribute__((used)) = "ge.socVersion";
const char *const CORE_TYPE __attribute__((used)) = "ge.engineType";
const char *const AICORE_NUM __attribute__((used)) = "ge.aicoreNum";
const char *const L1_FUSION __attribute__((used)) = "ge.l1Fusion";
const char *const BUFFER_OPTIMIZE __attribute__((used)) = "ge.bufferOptimize";
const char *const ENABLE_SMALL_CHANNEL __attribute__((used)) = "ge.enableSmallChannel";
const char *const ENABLE_COMPRESS_WEIGHT __attribute__((used)) = "ge.enableCompressWeight";
const char *const FUSION_SWITCH_FILE __attribute__((used)) = "ge.fusionSwitchFile";
const char *const SAVE_ORIGINAL_MODEL __attribute__((used)) = "ge.saveOriginalModel";
const char *const ORIGINAL_MODEL_FILE __attribute__((used)) = "ge.originalModelFile";
const char *const INPUT_FP16_NODES __attribute__((used)) = "ge.INPUT_NODES_SET_FP16";
const char *const OP_DEBUG_LEVEL __attribute__((used)) = "ge.opDebugLevel";
} // namespace configure_option
// Configure stream num by Session constructor options param,
// its value should be int32_t type, default value is "1"
const std::string STREAM_NUM = "ge.streamNum";
const std::string STREAM_NUM __attribute__((used)) = "ge.streamNum";

// Configure add head stream to model.
// its value should be "0" or "1", default value is "0"
const std::string HEAD_STREAM = "ge.headStream";
const std::string HEAD_STREAM __attribute__((used)) = "ge.headStream";

// Configure perf level by Session constructor options param,
// its value please see enum PerfLevel, default value is "4"
const std::string PERF_LEVEL = "ge.perfLevel";
const std::string PERF_LEVEL __attribute__((used)) = "ge.perfLevel";

// Configure encrypt mode by Session constructor options param,
// its value should be int32_t type, default value is "-1"
const std::string ENCRYPT_MODE = "ge.encryptMode";
const std::string ENCRYPT_MODE __attribute__((used)) = "ge.encryptMode";

// configure ek file by Session constructor options param,
// its value should be file path, default value is ""
const std::string EK_FILE = "ge.ekFile";
const std::string EK_FILE __attribute__((used)) = "ge.ekFile";

// Configure cert file by Session constructor options param,
// its value should be file path, default value is ""
const std::string CERT_FILE = "ge.certFile";
const std::string CERT_FILE __attribute__((used)) = "ge.certFile";

// Configure hw key file by Session constructor options param,
// its value should be file path, default value is ""
const std::string HW_KEY_FILE = "ge.hwKeyFile";
const std::string HW_KEY_FILE __attribute__((used)) = "ge.hwKeyFile";

// Configure private file by Session constructor options param,
// its value should be file path, default value is ""
const std::string PRIVATE_KEY_FILE = "ge.privateKeyFile";
const std::string PRIVATE_KEY_FILE __attribute__((used)) = "ge.privateKeyFile";

// Configure framework type by Session constructor options param,
// its value please see enum FrameworkType, default value is "3"
const std::string FRAMEWORK_TYPE = "ge.frameworkType";
const std::string FRAMEWORK_TYPE __attribute__((used)) = "ge.frameworkType";

// Configure calibration info file by Session constructor options param,
// its value should be file path, default value is ""
const std::string CALIBRATION_CONF_FILE = "ge.calibrationConfFile";
const std::string CALIBRATION_CONF_FILE __attribute__((used)) = "ge.calibrationConfFile";

// Configure insert op info file by Session constructor options param,
// its value should be file path, default value is ""
const std::string INSERT_OP_FILE = "ge.insertOpFile";
const std::string INSERT_OP_FILE __attribute__((used)) = "ge.insertOpFile";

// Configure output node name by Session constructor options param,
// its value should be std::string type, default value is ""
const std::string OUTPUT_NODE_NAME = "ge.outputNodeName";
const std::string OUTPUT_NODE_NAME __attribute__((used)) = "ge.outputNodeName";

// Configure weight compress flag by Session constructor options param,
// its value should be "0" or "1", default value is "0"
const std::string COMPRESS_FLAG = "ge.compressFlag";
const std::string COMPRESS_FLAG __attribute__((used)) = "ge.compressFlag";

const std::string PRECISION_MODE = "ge.exec.precision_mode";
const std::string PRECISION_MODE __attribute__((used)) = "ge.exec.precision_mode";

// Configure single op flag for FE
// its value should be "0" or "1", default value is "0"
const std::string SINGLE_OP_FLAG = "ge.exec.single_op";
const std::string SINGLE_OP_FLAG __attribute__((used)) = "ge.exec.single_op";

// Configure train flag by Session constructor options param,
// its value should be "0" or "1", default value is "0"
const std::string TRAIN_FLAG = "ge.trainFlag";
const std::string TRAIN_FLAG __attribute__((used)) = "ge.trainFlag";

// Configure run flag by Session constructor options param,
// its value should be "0" or "1", default value is "0"
const std::string RUN_FLAG = "ge.runFlag";
const std::string RUN_FLAG __attribute__((used)) = "ge.runFlag";

// Configure run flag by Session constructor options param,
// its value should be "0" or "1", default value is "0"
// this option is to enable local framework op feature
const std::string LOCAL_FMKOP_FLAG = "ge.enabledLocalFmkop";
const std::string LOCAL_FMKOP_FLAG __attribute__((used)) = "ge.enabledLocalFmkop";

// Configure run flag by Session constructor options param,
// its value should be a path
// this option is to obtain the TBE op plugin path
const std::string TBE_PLUGIN_PATH_FLAG = "ge.TBE_plugin_path";
const std::string TBE_PLUGIN_PATH_FLAG __attribute__((used)) = "ge.TBE_plugin_path";

// Configure run flag by Session constructor options param,
// its value should be a path
// this option is to obtain the DDK Version info
const std::string DDK_VERSION_FLAG = "ge.DDK_version";
const std::string DDK_VERSION_FLAG __attribute__((used)) = "ge.DDK_version";

// Configure run flag by Session constructor options param,
// its value should be a path
// this option is to obtain fe flag
const std::string GE_FE_FLAG = "ge.feFlag";
const std::string GE_FE_FLAG __attribute__((used)) = "ge.feFlag";

// Configure stream max parallel num only by Session constructor options param,
// its value should be stream:int, such as "DNN_V100:2,DNN_HCCL:3",
// default value is "1", such as "DNN_V100:1,DNN_HCCL:1"
// this option is to obtain stream max parallel num
const std::string STREAM_MAX_PARALLEL_NUM = "ge.streamMaxParallelNum";
const std::string STREAM_MAX_PARALLEL_NUM __attribute__((used)) = "ge.streamMaxParallelNum";

// congigure outputDatatype to setting net output type
const std::string OUTPUT_DATATYPE = "ge.outputDatatype";
const std::string OUTPUT_DATATYPE __attribute__((used)) = "ge.outputDatatype";

// congigure opSelectImplmode to setting op select implmode
const std::string OP_SELECT_IMPL_MODE = "ge.opSelectImplmode";
const std::string OP_SELECT_IMPL_MODE __attribute__((used)) = "ge.opSelectImplmode";

// congigure optypelist_for_implmode to setting which op use implmode
const std::string OPTYPELIST_FOR_IMPLMODE = "ge.optypelistForImplmode";
const std::string OPTYPELIST_FOR_IMPLMODE __attribute__((used)) = "ge.optypelistForImplmode";

// configure whether to enable hcom parallel by session constructor options param,
// its value should be "0" or "1", default value is "0"
const std::string HCOM_PARALLEL = "ge.hcomParallel";
const std::string HCOM_PARALLEL __attribute__((used)) = "ge.hcomParallel";

// configure whether to use dynamic batch size
const char *const kDynamicBatchSize = "ge.dynamicBatchSize";
const char *const kDynamicBatchSize __attribute__((used)) = "ge.dynamicBatchSize";

const std::string INPUT_SHAPE = "ge.inputShape";
const std::string INPUT_SHAPE __attribute__((used)) = "ge.inputShape";

const std::string DYNAMIC_NODE_TYPE = "ge.dynamicNodeType";
const std::string DYNAMIC_NODE_TYPE __attribute__((used)) = "ge.dynamicNodeType";
// configure whether to use dynamic image size
const char *const kDynamicImageSize = "ge.dynamicImageSize";
const char *const kDynamicImageSize __attribute__((used)) = "ge.dynamicImageSize";

// Configure whether to use dynamic dims
const char *const kDynamicDims = "ge.dynamicDims";
const char *const kDynamicDims __attribute__((used)) = "ge.dynamicDims";

// Configure auto tune mode, this option only take effect while AUTO_TUNE_FLAG is Y,
// example: GA|RL, support configure multiple, split by |
const std::string AUTO_TUNE_MODE = "ge.autoTuneMode";
const std::string AUTO_TUNE_MODE __attribute__((used)) = "ge.autoTuneMode";

// Configure soc version , example: "Ascend310"
const std::string SOC_VERSION = "ge.socVersion";
const std::string SOC_VERSION __attribute__((used)) = "ge.socVersion";

// Configure core type "VectorEngine", default value is "AIcoreEngine"
const std::string CORE_TYPE = "ge.engineType";
const std::string CORE_TYPE __attribute__((used)) = "ge.engineType";

// Configure AICORE NUM
const std::string AICORE_NUM = "ge.aicoreNum";
const std::string AICORE_NUM __attribute__((used)) = "ge.aicoreNum";

// Configure L1FUSION
const std::string L1_FUSION = "ge.l1Fusion";
const std::string L1_FUSION __attribute__((used)) = "ge.l1Fusion";

// Configure l1,l2,and others optimize option
const std::string BUFFER_OPTIMIZE = "ge.bufferOptimize";
const std::string BUFFER_OPTIMIZE __attribute__((used)) = "ge.bufferOptimize";

// Configure Small Channel flag
const std::string ENABLE_SMALL_CHANNEL = "ge.enableSmallChannel";
const std::string ENABLE_SMALL_CHANNEL __attribute__((used)) = "ge.enableSmallChannel";

// Configure Compress Weight flag
const std::string ENABLE_COMPRESS_WEIGHT = "ge.enableCompressWeight";
const std::string ENABLE_COMPRESS_WEIGHT __attribute__((used)) = "ge.enableCompressWeight";

// Configure fusion switch file path
const std::string FUSION_SWITCH_FILE = "ge.fusionSwitchFile";
const std::string FUSION_SWITCH_FILE __attribute__((used)) = "ge.fusionSwitchFile";

// Save original model
const std::string SAVE_ORIGINAL_MODEL = "ge.saveOriginalModel";
const std::string SAVE_ORIGINAL_MODEL __attribute__((used)) = "ge.saveOriginalModel";

// Save original model file name
const std::string ORIGINAL_MODEL_FILE = "ge.originalModelFile";
const std::string ORIGINAL_MODEL_FILE __attribute__((used)) = "ge.originalModelFile";

const char *const OPTION_GE_MAX_DUMP_FILE_NUM = "ge.maxDumpFileNum";
const char *const OPTION_GE_MAX_DUMP_FILE_SIZE = "ge.maxDumpFileSize";
const char *const OPTION_GE_MAX_DUMP_OP_NUM = "ge.maxDumpOpNum";
const char *const OPTION_GE_MAX_DUMP_FILE_NUM __attribute__((used)) = "ge.maxDumpFileNum";
const char *const OPTION_GE_MAX_DUMP_FILE_SIZE __attribute__((used)) = "ge.maxDumpFileSize";
const char *const OPTION_GE_MAX_DUMP_OP_NUM __attribute__((used)) = "ge.maxDumpOpNum";

// Configure for print op pass
// Its value should be "0" or "1", default value is "1"
const char *const ENABLE_PRINT_OP_PASS = "ge.enablePrintOpPass";
const char *const ENABLE_PRINT_OP_PASS __attribute__((used)) = "ge.enablePrintOpPass";

// Configure operator compilation path
// Its value should be file path, default value is "./"
const char *const DEBUG_DIR = "ge.debugDir";
const char *const DEBUG_DIR __attribute__((used)) = "ge.debugDir";

// Configure operator compiler cache path
// Its value should be file path, default value is "./"
const char *const OP_COMPILER_CACHE_DIR = "ge.op_compiler_cache_dir";
const char *const OP_COMPILER_CACHE_DIR __attribute__((used)) = "ge.op_compiler_cache_dir";

// Configure operator compiler cache mode
// Its value should be "disable", "enable" or "force", default value is "disable"
const char *const OP_COMPILER_CACHE_MODE = "ge.op_compiler_cache_mode";
const char *const OP_COMPILER_CACHE_MODE __attribute__((used)) = "ge.op_compiler_cache_mode";

// Configure whether to use single stream.
// Its value should be "true" or "false", default value is "false"
const char *const ENABLE_SINGLE_STREAM = "ge.enableSingleStream";
const char *const ENABLE_SINGLE_STREAM __attribute__((used)) = "ge.enableSingleStream";

// Configure input fp16 nodes
const std::string INPUT_FP16_NODES = "ge.INPUT_NODES_SET_FP16";
const std::string INPUT_FP16_NODES __attribute__((used)) = "ge.INPUT_NODES_SET_FP16";

// Configure debug level, its value should be 0(default), 1 or 2.
// 0: close debug; 1: open TBE compiler; 2: open ccec compiler
const std::string OP_DEBUG_LEVEL = "ge.opDebugLevel";
const std::string OP_DEBUG_LEVEL __attribute__((used)) = "ge.opDebugLevel";

// Configure model bank path
const std::string MDL_BANK_PATH_FLAG = "ge.mdl_bank_path";
const std::string MDL_BANK_PATH_FLAG __attribute__((used)) = "ge.mdl_bank_path";

// Configure display_model_info flag
const std::string DISPLAY_MODEL_INFO = "ge.display_model_info";
const std::string DISPLAY_MODEL_INFO __attribute__((used)) = "ge.display_model_info";

// Configure op bank path
const std::string OP_BANK_PATH_FLAG = "ge.op_bank_path";
const std::string OP_BANK_UPDATE_FLAG = "ge.op_bank_update";
const std::string OP_BANK_PATH_FLAG __attribute__((used)) = "ge.op_bank_path";
const std::string OP_BANK_UPDATE_FLAG __attribute__((used)) = "ge.op_bank_update";

// Configure for fix hcombroadcast format.
// when config model multi, broadcast format should be fixed
// 0: data multi; 1: model multi;
const std::string HCOM_MULTI_MODE = "ge.hcomMultiMode";
const std::string HCOM_MULTI_MODE __attribute__((used)) = "ge.hcomMultiMode";

// Graph run mode
enum GraphRunMode { PREDICTION = 0, TRAIN };
@@ -345,43 +345,43 @@ using Status = uint32_t;
using RunAsyncCallback = std::function<void(Status, std::vector<ge::OutputTensorInfo> &)>;
// for ir build
namespace ir_option {
static const char *const INPUT_FORMAT = "input_format";
static const char *const INPUT_SHAPE = "input_shape";
static const char *const OP_NAME_MAP = "op_name_map";
static const char *const IS_DYNAMIC_INPUT = "is_dynamic_input";
static const char *const IS_INPUT_ADJUST_HW_LAYOUT = "is_input_adjust_hw_layout";
static const char *const IS_OUTPUT_ADJUST_HW_LAYOUT = "is_output_adjust_hw_layout";
static const char *const ENABLE_SCOPE_FUSION_PASSES = "enable_scope_fusion_passes";
static const char *const OUTPUT = "output";
static const char *const DYNAMIC_BATCH_SIZE = kDynamicBatchSize;
static const char *const DYNAMIC_IMAGE_SIZE = kDynamicImageSize;
static const char *const DYNAMIC_DIMS = kDynamicDims;
static const char *const INSERT_OP_FILE = ge::INSERT_OP_FILE.c_str();
static const char *const PRECISION_MODE = ge::PRECISION_MODE.c_str();
static const char *const EXEC_DISABLE_REUSED_MEMORY = ge::OPTION_EXEC_DISABLE_REUSED_MEMORY;
static const char *const AUTO_TUNE_MODE = ge::AUTO_TUNE_MODE.c_str();
static const char *const CORE_TYPE = ge::CORE_TYPE.c_str();
static const char *const SOC_VERSION = ge::SOC_VERSION.c_str();
static const char *const ENABLE_SINGLE_STREAM = ge::ENABLE_SINGLE_STREAM;
static const char *const AICORE_NUM = ge::AICORE_NUM.c_str();
static const char *const FUSION_SWITCH_FILE = ge::FUSION_SWITCH_FILE.c_str();
static const char *const ENABLE_SMALL_CHANNEL = ge::ENABLE_SMALL_CHANNEL.c_str();
static const char *const OP_SELECT_IMPL_MODE = ge::OP_SELECT_IMPL_MODE.c_str();
static const char *const OUTPUT_TYPE = ge::OUTPUT_DATATYPE.c_str();
static const char *const BUFFER_OPTIMIZE = ge::BUFFER_OPTIMIZE.c_str();
static const char *const ENABLE_COMPRESS_WEIGHT = ge::ENABLE_COMPRESS_WEIGHT.c_str();
static const char *const COMPRESS_WEIGHT_CONF = "compress_weight_conf";
static const char *const OUT_NODES = ge::OUTPUT_NODE_NAME.c_str();
static const char *const INPUT_FP16_NODES = ge::INPUT_FP16_NODES.c_str();
static const char *const LOG_LEVEL = "log";
static const char *const OPTYPELIST_FOR_IMPLMODE = ge::OPTYPELIST_FOR_IMPLMODE.c_str();
static const char *const DEBUG_DIR = ge::DEBUG_DIR;
static const char *const OP_COMPILER_CACHE_DIR = ge::OP_COMPILER_CACHE_DIR;
static const char *const OP_COMPILER_CACHE_MODE = ge::OP_COMPILER_CACHE_MODE;
static const char *const MDL_BANK_PATH = ge::MDL_BANK_PATH_FLAG.c_str();
static const char *const OP_BANK_PATH = ge::OP_BANK_PATH_FLAG.c_str();
static const char *const OP_BANK_UPDATE = ge::OP_BANK_UPDATE_FLAG.c_str();
static const char *const OP_DEBUG_LEVEL = ge::OP_DEBUG_LEVEL.c_str();
static const char *const INPUT_FORMAT __attribute__((used)) = "input_format";
static const char *const INPUT_SHAPE __attribute__((used)) = "input_shape";
static const char *const OP_NAME_MAP __attribute__((used)) = "op_name_map";
static const char *const IS_DYNAMIC_INPUT __attribute__((used)) = "is_dynamic_input";
static const char *const IS_INPUT_ADJUST_HW_LAYOUT __attribute__((used)) = "is_input_adjust_hw_layout";
static const char *const IS_OUTPUT_ADJUST_HW_LAYOUT __attribute__((used)) = "is_output_adjust_hw_layout";
static const char *const ENABLE_SCOPE_FUSION_PASSES __attribute__((used)) = "enable_scope_fusion_passes";
static const char *const OUTPUT __attribute__((used)) = "output";
static const char *const DYNAMIC_BATCH_SIZE __attribute__((used)) = kDynamicBatchSize;
static const char *const DYNAMIC_IMAGE_SIZE __attribute__((used)) = kDynamicImageSize;
static const char *const DYNAMIC_DIMS __attribute__((used)) = kDynamicDims;
static const char *const INSERT_OP_FILE __attribute__((used)) = ge::INSERT_OP_FILE.c_str();
static const char *const PRECISION_MODE __attribute__((used)) = ge::PRECISION_MODE.c_str();
static const char *const EXEC_DISABLE_REUSED_MEMORY __attribute__((used)) = ge::OPTION_EXEC_DISABLE_REUSED_MEMORY;
static const char *const AUTO_TUNE_MODE __attribute__((used)) = ge::AUTO_TUNE_MODE.c_str();
static const char *const CORE_TYPE __attribute__((used)) = ge::CORE_TYPE.c_str();
static const char *const SOC_VERSION __attribute__((used)) = ge::SOC_VERSION.c_str();
static const char *const ENABLE_SINGLE_STREAM __attribute__((used)) = ge::ENABLE_SINGLE_STREAM;
static const char *const AICORE_NUM __attribute__((used)) = ge::AICORE_NUM.c_str();
static const char *const FUSION_SWITCH_FILE __attribute__((used)) = ge::FUSION_SWITCH_FILE.c_str();
static const char *const ENABLE_SMALL_CHANNEL __attribute__((used)) = ge::ENABLE_SMALL_CHANNEL.c_str();
static const char *const OP_SELECT_IMPL_MODE __attribute__((used)) = ge::OP_SELECT_IMPL_MODE.c_str();
static const char *const OUTPUT_TYPE __attribute__((used)) = ge::OUTPUT_DATATYPE.c_str();
static const char *const BUFFER_OPTIMIZE __attribute__((used)) = ge::BUFFER_OPTIMIZE.c_str();
static const char *const ENABLE_COMPRESS_WEIGHT __attribute__((used)) = ge::ENABLE_COMPRESS_WEIGHT.c_str();
static const char *const COMPRESS_WEIGHT_CONF __attribute__((used)) = "compress_weight_conf";
static const char *const OUT_NODES __attribute__((used)) = ge::OUTPUT_NODE_NAME.c_str();
static const char *const INPUT_FP16_NODES __attribute__((used)) = ge::INPUT_FP16_NODES.c_str();
static const char *const LOG_LEVEL __attribute__((used)) = "log";
static const char *const OPTYPELIST_FOR_IMPLMODE __attribute__((used)) = ge::OPTYPELIST_FOR_IMPLMODE.c_str();
static const char *const DEBUG_DIR __attribute__((used)) = ge::DEBUG_DIR;
static const char *const OP_COMPILER_CACHE_DIR __attribute__((used)) = ge::OP_COMPILER_CACHE_DIR;
static const char *const OP_COMPILER_CACHE_MODE __attribute__((used)) = ge::OP_COMPILER_CACHE_MODE;
static const char *const MDL_BANK_PATH __attribute__((used)) = ge::MDL_BANK_PATH_FLAG.c_str();
static const char *const OP_BANK_PATH __attribute__((used)) = ge::OP_BANK_PATH_FLAG.c_str();
static const char *const OP_BANK_UPDATE __attribute__((used)) = ge::OP_BANK_UPDATE_FLAG.c_str();
static const char *const OP_DEBUG_LEVEL __attribute__((used)) = ge::OP_DEBUG_LEVEL.c_str();

// for interface: aclgrphBuildModel
#ifdef __GNUC__


+ 3
- 3
inc/external/ge/ge_ir_build.h View File

@@ -38,9 +38,9 @@
#include "graph/ge_error_codes.h"

namespace {
const int IR_MAJOR_VERSION = 1;
const int IR_MINOR_VERSION = 0;
const int IR_PATCH_VERSION = 0;
const int IR_MAJOR_VERSION __attribute__((used)) = 1;
const int IR_MINOR_VERSION __attribute__((used)) = 0;
const int IR_PATCH_VERSION __attribute__((used)) = 0;
} // namespace

namespace ge {


+ 5
- 5
inc/framework/common/ge_types.h View File

@@ -53,13 +53,13 @@ enum OpEngineType {

enum InputAippType { DATA_WITHOUT_AIPP = 0, DATA_WITH_STATIC_AIPP, DATA_WITH_DYNAMIC_AIPP, DYNAMIC_AIPP_NODE };

const char *const GE_ENGINE_ATTR_MEM_TYPE_HBM = "HBM";
const char *const GE_OPTION_EXEC_PLACEMENT = "ge.exec.placement";
const char *const GE_ENGINE_ATTR_MEM_TYPE_HBM __attribute__((used)) = "HBM";
const char *const GE_OPTION_EXEC_PLACEMENT __attribute__((used)) = "ge.exec.placement";

// profiling data
const uint32_t kTaskTypeAicore = 0;
const uint32_t kTaskTypeAicpu = 1;
const uint32_t kTaskTypeInvalid = 0xFFFF;
const uint32_t kTaskTypeAicore __attribute__((used)) = 0;
const uint32_t kTaskTypeAicpu __attribute__((used)) = 1;
const uint32_t kTaskTypeInvalid __attribute__((used)) = 0xFFFF;

// Data cache, including data address and length
struct DataBuffer {


+ 3
- 3
inc/framework/common/l2_cache_optimize.h View File

@@ -32,10 +32,10 @@ using std::vector;

namespace ge {
// Size of RC memory alignment, 2M
constexpr size_t ALIGN_SIZE = 2097152;
constexpr size_t ALIGN_SIZE __attribute__((used)) = 2097152;

constexpr uint32_t RC_VALUE_DEFAULT = 1;
constexpr uint32_t RC_VALUE_MAX = 32;
constexpr uint32_t RC_VALUE_DEFAULT __attribute__((used)) = 1;
constexpr uint32_t RC_VALUE_MAX __attribute__((used)) = 32;

// RC data type classification
enum RCType {


+ 2
- 2
inc/framework/common/op_types.h View File

@@ -52,8 +52,8 @@ class GE_FUNC_VISIBILITY OpTypeRegistrar {
#define REGISTER_OPTYPE_DECLARE(var_name, str_name) \
FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY extern const char *var_name;

#define REGISTER_OPTYPE_DEFINE(var_name, str_name) \
const char *var_name = str_name; \
#define REGISTER_OPTYPE_DEFINE(var_name, str_name) \
const char *var_name __attribute__((used)) = str_name; \
const OpTypeRegistrar g_##var_name##_reg(str_name);

#define IS_OPTYPE_EXISTING(str_name) (OpTypeContainer::Instance()->IsExisting(str_name))


+ 23
- 23
inc/framework/common/types.h View File

@@ -594,22 +594,22 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY extern const uint32_t MODEL_FIL
///
/// @brief model name length
///
static constexpr uint32_t MODEL_NAME_LENGTH = 32;
static constexpr uint32_t MODEL_NAME_LENGTH __attribute__((used)) = 32;

///
/// @brief length of user-defined information
///
static constexpr uint32_t USER_DEFINE_INFO_LENGTH = 32;
static constexpr uint32_t USER_DEFINE_INFO_LENGTH __attribute__((used)) = 32;

///
/// @brief length of the model file signature
///
static constexpr uint32_t MODEL_FILE_CHECKSUM_LENGTH = 64;
static constexpr uint32_t MODEL_FILE_CHECKSUM_LENGTH __attribute__((used)) = 64;

///
/// @brief length of the reserved field in the model file header
///
static constexpr uint32_t MODEL_FILE_RESERVED_LENGTH = 75;
static constexpr uint32_t MODEL_FILE_RESERVED_LENGTH __attribute__((used)) = 75;

///
/// @ingroup domi_omg
@@ -712,15 +712,15 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY extern const uint32_t DEFAULT_D
FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY extern const uint32_t NUM_ONE;

// dim default size value
static const int32_t DIM_DEFAULT_SIZE = 4;
static const int32_t DIM_DEFAULT_SIZE __attribute__((used)) = 4;

// the shape of c must be the mutiply of 16 for depthwise
static const uint32_t DEPTHWISE_DIM_C_BASE_NUM = 16;
static const uint32_t DEPTHWISE_DIM_C_BASE_NUM __attribute__((used)) = 16;

// C1HWNCoC0 dim size
static const int32_t DIM_C1HWNCoC0_SIZE = 6;
static const int32_t DIM_C1HWNCoC0_SIZE __attribute__((used)) = 6;
// C1HWNCoC0 C0 value
static const int C1HWCOC_C0_VALUE = 16;
static const int C1HWCOC_C0_VALUE __attribute__((used)) = 16;
// spatial default dim size
FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY extern const int32_t SPATIAL_DIM_DEFAULT_SIZE;

@@ -742,12 +742,12 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY extern const uint32_t NCHW_DIM_
FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY extern const uint32_t NCHW_DIM_W;

// default C1HWNCoC0 index
static const uint32_t C1HWNCoC0_DIM_C1 = 0;
static const uint32_t C1HWNCoC0_DIM_H = 1;
static const uint32_t C1HWNCoC0_DIM_W = 2;
static const uint32_t C1HWNCoC0_DIM_N = 3;
static const uint32_t C1HWNCoC0_DIM_Co = 4;
static const uint32_t C1HWNCoC0_DIM_C0 = 5;
static const uint32_t C1HWNCoC0_DIM_C1 __attribute__((used)) = 0;
static const uint32_t C1HWNCoC0_DIM_H __attribute__((used)) = 1;
static const uint32_t C1HWNCoC0_DIM_W __attribute__((used)) = 2;
static const uint32_t C1HWNCoC0_DIM_N __attribute__((used)) = 3;
static const uint32_t C1HWNCoC0_DIM_Co __attribute__((used)) = 4;
static const uint32_t C1HWNCoC0_DIM_C0 __attribute__((used)) = 5;

// default KCHW index
FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY extern const uint32_t KCHW_DIM_K;
@@ -830,7 +830,7 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY extern const uint32_t STREAM_SW
FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY extern const std::string NODE_NAME_GLOBAL_STEP;
FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY extern const std::string NODE_NAME_GLOBAL_STEP_ASSIGNADD;

static const int PLATFORM_VERSION_LEN = 20;
static const int PLATFORM_VERSION_LEN __attribute__((used)) = 20;

// Definition of the file header of the model file
struct ModelFileHeader {
@@ -853,16 +853,16 @@ struct ModelFileHeader {
uint8_t reserved[MODEL_FILE_RESERVED_LENGTH] = {0}; // Reserved field 75
};

static constexpr uint8_t TARGET_TYPE_LTTE_8BIT = 0;
static constexpr uint8_t TARGET_TYPE_MINI_8BIT = 1;
static constexpr uint8_t TARGET_TYPE_TINY_8BIT = 2;
static constexpr uint8_t TARGET_TYPE_LTTE_8BIT __attribute__((used)) = 0;
static constexpr uint8_t TARGET_TYPE_MINI_8BIT __attribute__((used)) = 1;
static constexpr uint8_t TARGET_TYPE_TINY_8BIT __attribute__((used)) = 2;

static constexpr int32_t PARTITION_TYPE_MODEL_DEF = 0;
static constexpr int32_t PARTITION_TYPE_WEIGHTS = 1;
static constexpr int32_t PARTITION_TYPE_TASK_INFO = 2;
static constexpr int32_t PARTITION_TYPE_MODEL_DEF __attribute__((used)) = 0;
static constexpr int32_t PARTITION_TYPE_WEIGHTS __attribute__((used)) = 1;
static constexpr int32_t PARTITION_TYPE_TASK_INFO __attribute__((used)) = 2;

// number of partitions in the current model
static constexpr uint32_t PARTITION_SIZE = 5;
static constexpr uint32_t PARTITION_SIZE __attribute__((used)) = 5;

enum ModelPartitionType { MODEL_DEF = 0, WEIGHTS_DATA, TASK_INFO, TBE_KERNELS, CUST_AICPU_KERNELS };

@@ -879,7 +879,7 @@ struct ModelPartitionTable {

#define SIZE_OF_MODEL_PARTITION_TABLE(table) (sizeof(ModelPartitionTable) + sizeof(ModelPartitionMemInfo) * (table).num)

static constexpr int32_t PTHREAD_CREAT_SUCCESS = 0; // pthread_creat success
static constexpr int32_t PTHREAD_CREAT_SUCCESS __attribute__((used)) = 0; // pthread_creat success

// Filter format
typedef enum tagDomiFilterFormat {


+ 2
- 2
inc/framework/common/util.h View File

@@ -213,7 +213,7 @@
* @ingroup domi_common
* @brief version of om.proto file
*/
static constexpr int32_t OM_PROTO_VERSION = 2;
static constexpr int32_t OM_PROTO_VERSION __attribute__((used)) = 2;

/**
* Finding an Integer Ceiling Value Without Precision Loss
@@ -227,7 +227,7 @@ using google::protobuf::Message;
/// @ingroup domi_common
/// @brief Maximum file path length
///
const int32_t DOMI_MAX_PATH_LEN = 256;
const int32_t DOMI_MAX_PATH_LEN __attribute__((used)) = 256;

///
/// @ingroup domi_common


+ 1
- 1
inc/framework/memory/memory_assigner.h View File

@@ -23,7 +23,7 @@
#include "graph/node.h"

namespace ge {
const int64_t MEM_ALIGN_SIZE = 512;
const int64_t MEM_ALIGN_SIZE __attribute__((used)) = 512;
class GE_FUNC_VISIBILITY MemoryAssigner {
public:
explicit MemoryAssigner(ge::ComputeGraphPtr compute_graph) : compute_graph_(std::move(compute_graph)) {}


+ 2
- 2
third_party/fwkacllib/inc/cce/fwk_adpt_struct.h View File

@@ -97,7 +97,7 @@ struct StrFWKKernel {
typedef StrFWKKernel FWKOperateParam;

// Extent info ShapeAndType
const uint32_t kMaxShapeDims = 8;
const uint32_t kMaxShapeDims __attribute__((used)) = 8;
#pragma pack(push, 1)
struct ShapeAndType {
int32_t type;
@@ -106,7 +106,7 @@ struct ShapeAndType {
#pragma pack(pop)

// Extend info structure for extInfoAddr
const uint32_t kExtInfoHeadSize = 8;
const uint32_t kExtInfoHeadSize __attribute__((used)) = 8;

#pragma pack(push, 1)
struct ExtInfo {


+ 2
- 2
third_party/fwkacllib/inc/hccl/base.h View File

@@ -50,7 +50,7 @@ typedef enum {
HOROVOD_REDUCE_RESERVED /**< reserved */
} HorovodReduceOp;

const u32 HCCL_MAX_SEGMENT_NUM = 8; // The max number of gradient segments.
const u32 HCCL_MAX_SEGMENT_NUM __attribute__((used)) = 8; // The max number of gradient segments.

/**
* @brief the feature of the model
@@ -72,7 +72,7 @@ struct MemRegisterAddr {
/*
* @brief The max number of memory register address for remote access.
*/
const u32 HCCL_MAX_MEM_REGISTER_NUM = 32;
const u32 HCCL_MAX_MEM_REGISTER_NUM __attribute__((used)) = 32;

enum GradSplitForceMode {
FORCE_NONE, /**< no force */


+ 1
- 1
third_party/fwkacllib/inc/runtime/base.h View File

@@ -34,7 +34,7 @@ extern "C" {
#endif

typedef int32_t rtError_t;
static const int32_t RT_ERROR_NONE = 0; // success
static const int32_t RT_ERROR_NONE __attribute__((used)) = 0; // success

/**
* @ingroup dvrt_base


Loading…
Cancel
Save