Browse Source

!2134 upgrade Ascend software package 8 Sep 22

Merge pull request !2134 from yanghaoran/master
pull/2135/head
yanghaoran Gitee 2 years ago
parent
commit
b56450bde6
No known key found for this signature in database GPG Key ID: 173E9B9CA92EEF8F
19 changed files with 187 additions and 54 deletions
  1. +1
    -1
      inc/external/acl/acl_prof.h
  2. +49
    -0
      inc/external/acl/acl_tdt_queue.h
  3. +1
    -5
      inc/external/ge/ge_api_types.h
  4. +1
    -0
      inc/external/hccl/hccl_types.h
  5. +4
    -4
      inc/framework/common/debug/log.h
  6. +6
    -0
      inc/framework/common/ge_types.h
  7. +5
    -0
      inc/framework/common/helper/model_helper.h
  8. +0
    -2
      inc/framework/common/profiling/ge_profiling.h
  9. +1
    -1
      inc/framework/common/profiling_definitions.h
  10. +3
    -3
      inc/framework/common/taskdown_common.h
  11. +0
    -19
      inc/framework/common/util.h
  12. +7
    -0
      inc/framework/runtime/model_desc.h
  13. +1
    -1
      metadef
  14. +14
    -14
      third_party/fwkacllib/inc/cce/aicpu_engine.h
  15. +60
    -0
      third_party/fwkacllib/inc/ops/experiment_ops.h
  16. +29
    -0
      third_party/fwkacllib/inc/ops/image_ops.h
  17. +1
    -1
      third_party/fwkacllib/inc/ops/transformation_ops.h
  18. +1
    -0
      third_party/fwkacllib/inc/runtime/mem.h
  19. +3
    -3
      third_party/fwkacllib/inc/toolchain/prof_acl_api.h

+ 1
- 1
inc/external/acl/acl_prof.h View File

@@ -64,7 +64,7 @@ typedef enum {
ACL_SUBSCRIBE_OP = 0, ACL_SUBSCRIBE_OP = 0,
ACL_SUBSCRIBE_SUBGRAPH = 1, ACL_SUBSCRIBE_SUBGRAPH = 1,
ACL_SUBSCRIBE_OP_THREAD = 2, ACL_SUBSCRIBE_OP_THREAD = 2,
ACL_SUBSCRIBE_NONE
ACL_SUBSCRIBE_NONE = 0xFF
} aclprofSubscribeOpFlag; } aclprofSubscribeOpFlag;


typedef enum { ACL_SUBSCRIBE_ATTRI_THREADID = 0, ACL_SUBSCRIBE_ATTRI_NONE } aclprofSubscribeOpAttri; typedef enum { ACL_SUBSCRIBE_ATTRI_THREADID = 0, ACL_SUBSCRIBE_ATTRI_NONE } aclprofSubscribeOpAttri;


+ 49
- 0
inc/external/acl/acl_tdt_queue.h View File

@@ -53,6 +53,8 @@ typedef enum {
ACL_TDT_QUEUE_ROUTE_QUERY_DST_ID_UINT32 ACL_TDT_QUEUE_ROUTE_QUERY_DST_ID_UINT32
} acltdtQueueRouteQueryInfoParamType; } acltdtQueueRouteQueryInfoParamType;


typedef enum { ACL_TDT_NORMAL_MEM = 0, ACL_TDT_DVPP_MEM } acltdtAllocBufType;

/** /**
* @ingroup AscendCL * @ingroup AscendCL
* @brief create queue * @brief create queue
@@ -257,6 +259,53 @@ ACL_FUNC_VISIBILITY aclError acltdtFreeBuf(acltdtBuf buf);
*/ */
ACL_FUNC_VISIBILITY aclError acltdtGetBufData(const acltdtBuf buf, void **dataPtr, size_t *size); ACL_FUNC_VISIBILITY aclError acltdtGetBufData(const acltdtBuf buf, void **dataPtr, size_t *size);


/**
* @ingroup AscendCL
* @brief get private data buf address and size
*
* @param buf [IN] acltdtBuf
* @param dataPtr [IN/OUT] pointer to the user ptr
* @param size [IN] the current private data area size, less than or equal to 96B
* @param offset [IN] address offset, less than or equal to 96B
*
* @retval ACL_SUCCESS The function is successfully executed.
* @retval OtherValues Failure
*
* @see acltdtGetBufUserData
*/
ACL_FUNC_VISIBILITY aclError acltdtGetBufUserData(const acltdtBuf buf, void *dataPtr, size_t size, size_t offset);

/**
* @ingroup AscendCL
* @brief set private data buf address and size
*
* @param buf [OUT] acltdtBuf
* @param dataPtr [IN] pointer to the user ptr
* @param size [IN] the current private data area size, less than or equal to 96B
* @param offset [IN] address offset, less than or equal to 96B
*
* @retval ACL_SUCCESS The function is successfully executed.
* @retval OtherValues Failure
*
* @see acltdtSetBufUserData
*/
ACL_FUNC_VISIBILITY aclError acltdtSetBufUserData(acltdtBuf buf, const void *dataPtr, size_t size, size_t offset);

/**
* @ingroup AscendCL
* @brief copy buf ref
*
* @param buf [IN] acltdtBuf
* @param newBuf [OUT] Make a reference copy of the data area of buf and
* create a new buf header pointing to the same data area
*
* @retval ACL_SUCCESS The function is successfully executed.
* @retval OtherValues Failure
*
* @see acltdtCopyBufRef
*/
ACL_FUNC_VISIBILITY aclError acltdtCopyBufRef(const acltdtBuf buf, acltdtBuf *newBuf);

/** /**
* @ingroup AscendCL * @ingroup AscendCL
* @brief Create the queue attr * @brief Create the queue attr


+ 1
- 5
inc/external/ge/ge_api_types.h View File

@@ -395,9 +395,6 @@ const std::string RECOMPUTE = "ge.recompute";


const char_t *const GRAPH_PARALLEL_OPTION_PATH = "ge.graphParallelOptionPath"; const char_t *const GRAPH_PARALLEL_OPTION_PATH = "ge.graphParallelOptionPath";


// 1: Complete graph resource evaluation(Inclusion graph fusion optimization)
// 2: Simplified graph resource evaluation(No graph fusion optimization)
const char_t *const EVALUATE_GRAPH_RESOURCE_MODE = "ge.evaluateGraphResourceMode";
// Graph run mode // Graph run mode
enum GraphRunMode { PREDICTION = 0, TRAIN }; enum GraphRunMode { PREDICTION = 0, TRAIN };
// Topo sorting mode // Topo sorting mode
@@ -518,8 +515,7 @@ const std::set<std::string> ir_builder_suppported_options = {INPUT_FORMAT,
SHAPE_GENERALIZED_BUILD_MODE, SHAPE_GENERALIZED_BUILD_MODE,
MODIFY_MIXLIST, MODIFY_MIXLIST,
CUSTOMIZE_DTYPES, CUSTOMIZE_DTYPES,
BUILD_INNER_MODEL,
EVALUATE_GRAPH_RESOURCE_MODE};
BUILD_INNER_MODEL};


// for interface: aclgrphParse // for interface: aclgrphParse
const std::set<std::string> ir_parser_suppported_options = { const std::set<std::string> ir_parser_suppported_options = {


+ 1
- 0
inc/external/hccl/hccl_types.h View File

@@ -88,6 +88,7 @@ typedef enum {
HCCL_DATA_TYPE_UINT16 = 8, /**< uint16 */ HCCL_DATA_TYPE_UINT16 = 8, /**< uint16 */
HCCL_DATA_TYPE_UINT32 = 9, /**< uint32 */ HCCL_DATA_TYPE_UINT32 = 9, /**< uint32 */
HCCL_DATA_TYPE_FP64 = 10, /**< fp64 */ HCCL_DATA_TYPE_FP64 = 10, /**< fp64 */
HCCL_DATA_TYPE_BFP16 = 11, /**< bfp16 */
HCCL_DATA_TYPE_RESERVED /**< reserved */ HCCL_DATA_TYPE_RESERVED /**< reserved */
} HcclDataType; } HcclDataType;




+ 4
- 4
inc/framework/common/debug/log.h View File

@@ -178,16 +178,16 @@
} }


#define GE_ERRORLOG_AND_ERRORMSG(_status, errormsg) \ #define GE_ERRORLOG_AND_ERRORMSG(_status, errormsg) \
{ \
do { \
GELOGE((_status), "[Check][InnerData]%s", (errormsg)); \ GELOGE((_status), "[Check][InnerData]%s", (errormsg)); \
REPORT_INNER_ERROR("E19999", "%s", (errormsg)); \ REPORT_INNER_ERROR("E19999", "%s", (errormsg)); \
}
} while (false)


#define GE_WARNINGLOG_AND_ERRORMSG(errormsg) \ #define GE_WARNINGLOG_AND_ERRORMSG(errormsg) \
{ \
do { \
GELOGW("%s", (errormsg)); \ GELOGW("%s", (errormsg)); \
ErrorManager::GetInstance().ATCReportErrMessage("E10052", {"reason"}, {(errormsg)}); \ ErrorManager::GetInstance().ATCReportErrMessage("E10052", {"reason"}, {(errormsg)}); \
}
} while (false)


#define GE_CHK_LOG_AND_ERRORMSG(expr, _status, errormsg) \ #define GE_CHK_LOG_AND_ERRORMSG(expr, _status, errormsg) \
do { \ do { \


+ 6
- 0
inc/framework/common/ge_types.h View File

@@ -68,6 +68,8 @@ const char_t *const GE_OPTION_EXEC_PLACEMENT = "ge.exec.placement";


const std::string kTaskTypeAicore = "AI_CORE"; const std::string kTaskTypeAicore = "AI_CORE";
const std::string kTaskTypeAicpu = "AI_CPU"; const std::string kTaskTypeAicpu = "AI_CPU";
const std::string kTaskTypeWriteBackData = "WRITE_BACK";
const std::string kTaskTypeInvalidData = "INVALID";
const std::string kTaskTypeInvalid = "TASK_TYPE_INVALID"; const std::string kTaskTypeInvalid = "TASK_TYPE_INVALID";
const std::string kTaskTypeFftsPlus = "FFTS_PLUS"; const std::string kTaskTypeFftsPlus = "FFTS_PLUS";
const std::string kEngineNameVectorCore = "VectorEngine"; const std::string kEngineNameVectorCore = "VectorEngine";
@@ -381,5 +383,9 @@ struct ModelQueueParam {
std::vector<uint32_t> input_queues; std::vector<uint32_t> input_queues;
std::vector<uint32_t> output_queues; std::vector<uint32_t> output_queues;
}; };

// internal options
// 1: Graph resource evaluation does not limit model memory size.
const char_t *const EVALUATE_GRAPH_RESOURCE_MODE = "ge.evaluateGraphResourceMode";
} // namespace ge } // namespace ge
#endif // INC_FRAMEWORK_COMMON_GE_TYPES_H_ #endif // INC_FRAMEWORK_COMMON_GE_TYPES_H_

+ 5
- 0
inc/framework/common/helper/model_helper.h View File

@@ -49,6 +49,10 @@ class GE_FUNC_VISIBILITY ModelHelper {
is_offline_ = val; is_offline_ = val;
} }


void SetSharedWeightFlag(const bool val) {
is_shared_weight_ = val;
}

bool GetModelType() const { bool GetModelType() const {
return is_unknown_shape_model_; return is_unknown_shape_model_;
} }
@@ -60,6 +64,7 @@ class GE_FUNC_VISIBILITY ModelHelper {
bool is_assign_model_ = false; bool is_assign_model_ = false;
bool is_offline_ = true; bool is_offline_ = true;
bool is_unknown_shape_model_ = false; bool is_unknown_shape_model_ = false;
bool is_shared_weight_ = false;
ModelFileHeader *file_header_ = nullptr; ModelFileHeader *file_header_ = nullptr;
GeModelPtr model_; GeModelPtr model_;
GeRootModelPtr root_model_; GeRootModelPtr root_model_;


+ 0
- 2
inc/framework/common/profiling/ge_profiling.h View File

@@ -20,10 +20,8 @@
#include "external/ge/ge_api_error_codes.h" #include "external/ge/ge_api_error_codes.h"
#include "runtime/base.h" #include "runtime/base.h"


///
/// @brief Output the profiling data of single operator in Pytorch, and does not support multithreading /// @brief Output the profiling data of single operator in Pytorch, and does not support multithreading
/// @return Status result /// @return Status result
///
GE_FUNC_VISIBILITY ge::Status ProfSetStepInfo(const uint64_t index_id, const uint16_t tag_id, rtStream_t const stream); GE_FUNC_VISIBILITY ge::Status ProfSetStepInfo(const uint64_t index_id, const uint16_t tag_id, rtStream_t const stream);


GE_FUNC_VISIBILITY ge::Status ProfGetDeviceFormGraphId(const uint32_t graph_id, uint32_t &device_id); GE_FUNC_VISIBILITY ge::Status ProfGetDeviceFormGraphId(const uint32_t graph_id, uint32_t &device_id);


+ 1
- 1
inc/framework/common/profiling_definitions.h View File

@@ -1,5 +1,5 @@
/** /**
* Copyright 2021 Huawei Technologies Co., Ltd
* Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.


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

@@ -39,12 +39,12 @@ enum class ccStatus_t {
enum class ccKernelType { enum class ccKernelType {
CCE_AI_CORE = 0, /* cce aicore */ CCE_AI_CORE = 0, /* cce aicore */
CCE_AI_CPU = 1, /* cce aicpu */ CCE_AI_CPU = 1, /* cce aicpu */
TE = 2, /* te operator*/
TE = 2, /* te operator */
CUSTOMIZED = 3, /* customized operator */ CUSTOMIZED = 3, /* customized operator */
TE_AI_CORE = 4, /* te aicore operator*/
TE_AI_CORE = 4, /* te aicore operator */
TE_AI_CPU = 5, /* te aicpu operator */ TE_AI_CPU = 5, /* te aicpu operator */
AI_CPU = 6, /* aicpu */ AI_CPU = 6, /* aicpu */
CUST_AI_CPU = 7, /* custom aicpu*/
CUST_AI_CPU = 7, /* custom aicpu */
HOST_CPU = 8, /* host cpu */ HOST_CPU = 8, /* host cpu */
INVALID = 10000 /* unknown kernel type */ INVALID = 10000 /* unknown kernel type */
}; };


+ 0
- 19
inc/framework/common/util.h View File

@@ -245,15 +245,12 @@ GE_FUNC_VISIBILITY std::string ToString(const std::vector<T> &v) {
return ss.str(); return ss.str();
} }


///
/// @ingroup: domi_common /// @ingroup: domi_common
/// @brief: get length of file /// @brief: get length of file
/// @param [in] input_file: path of file /// @param [in] input_file: path of file
/// @return int64_t: File length. If the file length fails to be obtained, the value -1 is returned. /// @return int64_t: File length. If the file length fails to be obtained, the value -1 is returned.
///
GE_FUNC_VISIBILITY extern int64_t GetFileLength(const std::string &input_file); GE_FUNC_VISIBILITY extern int64_t GetFileLength(const std::string &input_file);


///
/// @ingroup domi_common /// @ingroup domi_common
/// @brief Reads all data from a binary file. /// @brief Reads all data from a binary file.
/// @param [in] file_name path of file /// @param [in] file_name path of file
@@ -261,31 +258,23 @@ GE_FUNC_VISIBILITY extern int64_t GetFileLength(const std::string &input_file);
/// @param [out] length Output memory size /// @param [out] length Output memory size
/// @return false fail /// @return false fail
/// @return true success /// @return true success
///
GE_FUNC_VISIBILITY bool ReadBytesFromBinaryFile(const char_t *const file_name, char_t **const buffer, int32_t &length); GE_FUNC_VISIBILITY bool ReadBytesFromBinaryFile(const char_t *const file_name, char_t **const buffer, int32_t &length);


///
/// @ingroup domi_common /// @ingroup domi_common
/// @brief Recursively Creating a Directory /// @brief Recursively Creating a Directory
/// @param [in] directory_path Path, which can be a multi-level directory. /// @param [in] directory_path Path, which can be a multi-level directory.
/// @return 0 success /// @return 0 success
/// @return -1 fail /// @return -1 fail
///
GE_FUNC_VISIBILITY extern int32_t CreateDirectory(const std::string &directory_path); GE_FUNC_VISIBILITY extern int32_t CreateDirectory(const std::string &directory_path);


///
/// @ingroup domi_common /// @ingroup domi_common
/// @brief Obtains the current time string. /// @brief Obtains the current time string.
/// @return Time character string in the format : %Y%m%d%H%M%S, eg: 20171011083555 /// @return Time character string in the format : %Y%m%d%H%M%S, eg: 20171011083555
///
GE_FUNC_VISIBILITY std::string CurrentTimeInStr(); GE_FUNC_VISIBILITY std::string CurrentTimeInStr();


///
/// @ingroup domi_common /// @ingroup domi_common
/// @brief Obtains the absolute time (timestamp) of the current system. /// @brief Obtains the absolute time (timestamp) of the current system.
/// @return Timestamp, in microseconds (US) /// @return Timestamp, in microseconds (US)
///
///
GE_FUNC_VISIBILITY uint64_t GetCurrentTimestamp(); GE_FUNC_VISIBILITY uint64_t GetCurrentTimestamp();


/// ///
@@ -296,15 +285,12 @@ GE_FUNC_VISIBILITY uint64_t GetCurrentTimestamp();
/// ///
GE_FUNC_VISIBILITY uint32_t GetCurrentSecondTimestap(); GE_FUNC_VISIBILITY uint32_t GetCurrentSecondTimestap();


///
/// @ingroup domi_common /// @ingroup domi_common
/// @brief Absolute path for obtaining files. /// @brief Absolute path for obtaining files.
/// @param [in] path of input file /// @param [in] path of input file
/// @param [out] Absolute path of a file. If the absolute path cannot be obtained, an empty string is returned /// @param [out] Absolute path of a file. If the absolute path cannot be obtained, an empty string is returned
///
GE_FUNC_VISIBILITY std::string RealPath(const char_t *path); GE_FUNC_VISIBILITY std::string RealPath(const char_t *path);


///
/// @ingroup domi_common /// @ingroup domi_common
/// @brief Check whether the specified input file path is valid. /// @brief Check whether the specified input file path is valid.
/// 1. The specified path cannot be empty. /// 1. The specified path cannot be empty.
@@ -312,23 +298,18 @@ GE_FUNC_VISIBILITY std::string RealPath(const char_t *path);
/// 3. The file path exists and is readable. /// 3. The file path exists and is readable.
/// @param [in] file_path path of input file /// @param [in] file_path path of input file
/// @param [out] result /// @param [out] result
///
GE_FUNC_VISIBILITY bool CheckInputPathValid(const std::string &file_path, const std::string &atc_param = ""); GE_FUNC_VISIBILITY bool CheckInputPathValid(const std::string &file_path, const std::string &atc_param = "");


///
/// @ingroup domi_common /// @ingroup domi_common
/// @brief Checks whether the specified output file path is valid. /// @brief Checks whether the specified output file path is valid.
/// @param [in] file_path path of output file /// @param [in] file_path path of output file
/// @param [out] result /// @param [out] result
///
GE_FUNC_VISIBILITY bool CheckOutputPathValid(const std::string &file_path, const std::string &atc_param = ""); GE_FUNC_VISIBILITY bool CheckOutputPathValid(const std::string &file_path, const std::string &atc_param = "");


///
/// @ingroup domi_common /// @ingroup domi_common
/// @brief Check whether the file path meets the whitelist verification requirements. /// @brief Check whether the file path meets the whitelist verification requirements.
/// @param [in] str file path /// @param [in] str file path
/// @param [out] result /// @param [out] result
///
GE_FUNC_VISIBILITY bool ValidateStr(const std::string &file_path, const std::string &mode); GE_FUNC_VISIBILITY bool ValidateStr(const std::string &file_path, const std::string &mode);


GE_FUNC_VISIBILITY Status ConvertToInt32(const std::string &str, int32_t &val); GE_FUNC_VISIBILITY Status ConvertToInt32(const std::string &str, int32_t &val);


+ 7
- 0
inc/framework/runtime/model_desc.h View File

@@ -27,6 +27,10 @@
namespace gert { namespace gert {
class VISIBILITY_EXPORT ShapeRange { class VISIBILITY_EXPORT ShapeRange {
public: public:
ShapeRange() = default;
ShapeRange(const Shape &min_shape, const Shape &max_shape);
bool operator==(const ShapeRange &other) const;

const Shape &GetMin() const; const Shape &GetMin() const;
const Shape &GetMax() const; const Shape &GetMax() const;
Shape &MutableMin(); Shape &MutableMin();
@@ -76,6 +80,9 @@ class VISIBILITY_EXPORT ModelDesc {
const ModelIoDesc *GetOutputDesc(size_t index) const; const ModelIoDesc *GetOutputDesc(size_t index) const;
const ModelIoDesc *GetAllOutputsDesc(size_t &output_num) const; const ModelIoDesc *GetAllOutputsDesc(size_t &output_num) const;


size_t GetInputNum() const;
size_t GetOutputNum() const;

ModelIoDesc *MutableInputDesc(size_t index); ModelIoDesc *MutableInputDesc(size_t index);
ModelIoDesc *MutableOutputDesc(size_t index); ModelIoDesc *MutableOutputDesc(size_t index);
ModelIoDesc *AllMutableIoDesc(size_t &input_num, size_t &output_num); ModelIoDesc *AllMutableIoDesc(size_t &input_num, size_t &output_num);


+ 1
- 1
metadef

@@ -1 +1 @@
Subproject commit 03482feb52fd7cc8544231f32891c86db3bc91a2
Subproject commit ed43bd5a956c70e85e6f9d0a8f2277691a5ce4a2

+ 14
- 14
third_party/fwkacllib/inc/cce/aicpu_engine.h View File

@@ -1,5 +1,5 @@
/** /**
* Copyright 2019-2020 Huawei Technologies Co., Ltd
* Copyright (C) Huawei Technologies Co., Ltd. 2019-2022. All rights reserved.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -13,8 +13,8 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
#ifndef AICPU_ENGINE_H__
#define AICPU_ENGINE_H__
#ifndef AICPU_ENGINE_H
#define AICPU_ENGINE_H


#include <stdint.h> #include <stdint.h>


@@ -23,16 +23,16 @@ extern "C" {
#endif #endif


typedef enum { typedef enum {
AE_STATUS_SUCCESS = 0,
AE_STATUS_BAD_PARAM = 1,
AE_STATUS_OPEN_SO_FAILED = 2,
AE_STATUS_GET_KERNEL_NAME_FAILED = 3,
AE_STATUS_INNER_ERROR = 4,
AE_STATUS_KERNEL_API_INNER_ERROR = 5,
AE_STATUS_END_OF_SEQUENCE = 6,
AE_STATUS_DUMP_FAILED = 7,
AE_STATUS_TASK_WAIT = 101,
AE_STATUS_RESERVED
AE_STATUS_SUCCESS = 0,
AE_STATUS_BAD_PARAM = 1,
AE_STATUS_OPEN_SO_FAILED = 2,
AE_STATUS_GET_KERNEL_NAME_FAILED = 3,
AE_STATUS_INNER_ERROR = 4,
AE_STATUS_KERNEL_API_INNER_ERROR = 5,
AE_STATUS_END_OF_SEQUENCE = 6,
AE_STATUS_DUMP_FAILED = 7,
AE_STATUS_TASK_WAIT = 101,
AE_STATUS_RESERVED
} aeStatus_t; } aeStatus_t;


/** /**
@@ -59,4 +59,4 @@ aeStatus_t aeBatchLoadKernelSo(const uint32_t loadSoNum, const char *soPaths[],
} }
#endif #endif


#endif // AICPU_ENGINE_H__
#endif // AICPU_ENGINE_H

+ 60
- 0
third_party/fwkacllib/inc/ops/experiment_ops.h View File

@@ -293,6 +293,66 @@ REG_OP(AutoBatch)
.ATTR(padding, Bool, false) .ATTR(padding, Bool, false)
.ATTR(slide_stride, Int, 0) .ATTR(slide_stride, Int, 0)
.OP_END_FACTORY_REG(AutoBatch) .OP_END_FACTORY_REG(AutoBatch)

/**
* @brief YUVToRGB

* @par Inputs:
* @li x: A 4-D uint8 Tensor.
* Must set the format, supported format list ["NYUV"].
* @li matrix: A 1-D float tensor of 2x3x3 elements

* @par Outputs:
* @li y: A 4-D uint8 Tensor.
* Must set the format, supported format list ["NCHW, NHWC"].

* @par Attributes:
* @li matrix_type: An Int attr, Defaults to 0.
* support list [ 0: CSC_MATRIX_BT601_WIDE,
* 1: CSC_MATRIX_BT601_NARROW,
* 2: CSC_MATRIX_BT709_WIDE,
* 3: CSC_MATRIX_BT709_NARROW,
* 4: CSC_MATRIX_BT2020_WIDE,
* 5: CSC_MATRIX_BT2020_NARROW,
* 6: CSC_MATRIX_USR_DEFINE ]
* @li rb_swap: An Int attr, Defaults to 0.
* support list [ 0: RGB, 1: BGR ]

* @attention Constraints:
* @li Only support in dvpp
*/

REG_OP(YUVToRGB)
.INPUT(x, TensorType({DT_UINT8}))
.OPTIONAL_INPUT(matrix, TensorType({DT_FLOAT}))
.OUTPUT(y, TensorType({DT_UINT8}))
.ATTR(matrix_type, Int, 0)
.ATTR(rb_swap, Int, 0)
.OP_END_FACTORY_REG(YUVToRGB)

/**
* @brief DecodeJpegPre

* @par Inputs:
* @li contents: A Tensor of type string. 0-D. The JPEG-encoded image.

* @par Outputs:
* @li dvpp_support: indicates if the dvpp support this jpeg image decode.

* @par Attributes:
* @li w_range: An required listInt contains width [min, max].
* @li h_range: An required listInt contains height [min, max].

* @attention Constraints:
* @li Only support in dvpp
*/

REG_OP(DecodeJpegPre)
.INPUT(contents, TensorType({DT_STRING}))
.OUTPUT(dvpp_support, BOOL)
.REQUIRED_ATTR(w_range, ListInt)
.REQUIRED_ATTR(h_range, ListInt)
.OP_END_FACTORY_REG(DecodeJpegPre)
} // namespace ge } // namespace ge


#endif // OPS_BUILT_IN_OP_PROTO_INC_EXPERIMENT_OPS_H_ #endif // OPS_BUILT_IN_OP_PROTO_INC_EXPERIMENT_OPS_H_

+ 29
- 0
third_party/fwkacllib/inc/ops/image_ops.h View File

@@ -2444,5 +2444,34 @@ REG_OP(ExtractGlimpseV2)
.ATTR(uniform_noise, Bool, true) .ATTR(uniform_noise, Bool, true)
.ATTR(noise, String, "uniform") .ATTR(noise, String, "uniform")
.OP_END_FACTORY_REG(ExtractGlimpseV2) .OP_END_FACTORY_REG(ExtractGlimpseV2)

/**
* @brief NormalizeV2 \n

* @par Inputs:
* @li x: A 4-D Tensor. Must be one of the following types: uint8, float16,
* float. Must set the format, supported format list ["NCHW, NHWC"].
* @li mean: A 1-D float tensor of "C(channel)" elements
* @li variance: A 1-D float tensor of "C(channel)" elements \n

* @par Outputs:
* @li y: A 4-D Tensor. Must be one of the following types: float16, float.
* Must set the format, supported format list ["NCHW, NHWC"]. \n

* @par Attributes:
* @li dtype: An Type attr, support type list [DT_FLOAT16, DT_FLOAT].
* Defaults to DT_FLOAT. \n

* @par Third-party framework compatibility
* Compatible with pytorch normalize operator.
*/

REG_OP(NormalizeV2)
.INPUT(x, TensorType({DT_UINT8, DT_FLOAT16, DT_FLOAT}))
.INPUT(mean, TensorType({DT_FLOAT}))
.INPUT(variance, TensorType({DT_FLOAT}))
.OUTPUT(y, TensorType({DT_FLOAT16, DT_FLOAT}))
.ATTR(dtype, Type, DT_FLOAT)
.OP_END_FACTORY_REG(NormalizeV2)
} // namespace ge } // namespace ge
#endif // OPS_BUILT_IN_OP_PROTO_INC_IMAGE_OPS_H_ #endif // OPS_BUILT_IN_OP_PROTO_INC_IMAGE_OPS_H_

+ 1
- 1
third_party/fwkacllib/inc/ops/transformation_ops.h View File

@@ -418,7 +418,7 @@ REG_OP(DepthToSpace)
*@li The size of the first dimension of input "x" must be divisible by (block_size * block_size). *@li The size of the first dimension of input "x" must be divisible by (block_size * block_size).
*@li "crops" is a 4Dshape [batch, height, width, depth], height = height_pad - crop_top - crop_bottom, *@li "crops" is a 4Dshape [batch, height, width, depth], height = height_pad - crop_top - crop_bottom,
*width = width_pad - crop_left - crop_right. *width = width_pad - crop_left - crop_right.
*@li block_size > 2
*@li block_size >= 2


*@par Third-party framework compatibility *@par Third-party framework compatibility
* Compatible with the TensorFlow operator BatchToSpace. * Compatible with the TensorFlow operator BatchToSpace.


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

@@ -32,6 +32,7 @@ extern "C" {
#define RT_MEMORY_TS_4G (0x40U) // Used for Ts memory(only 1951) #define RT_MEMORY_TS_4G (0x40U) // Used for Ts memory(only 1951)
#define RT_MEMORY_HOST (0x81U) // Memory on host #define RT_MEMORY_HOST (0x81U) // Memory on host
#define RT_MEMORY_SVM (0x90U) // Memory for SVM #define RT_MEMORY_SVM (0x90U) // Memory for SVM
#define RT_MEMORY_HOST_SVM (0x90U) // Memory for host SVM
#define RT_MEMORY_RESERVED (0x100U) #define RT_MEMORY_RESERVED (0x100U)


#define RT_MEMORY_L1 (0x1U << 16U) #define RT_MEMORY_L1 (0x1U << 16U)


+ 3
- 3
third_party/fwkacllib/inc/toolchain/prof_acl_api.h View File

@@ -8,6 +8,9 @@
#ifndef MSPROFILER_API_PROF_ACL_API_H_ #ifndef MSPROFILER_API_PROF_ACL_API_H_
#define MSPROFILER_API_PROF_ACL_API_H_ #define MSPROFILER_API_PROF_ACL_API_H_


#include <cstdint>
#include <cstddef>

// DataTypeConfig // DataTypeConfig
#define PROF_ACL_API 0x00000001ULL #define PROF_ACL_API 0x00000001ULL
#define PROF_TASK_TIME 0x00000002ULL #define PROF_TASK_TIME 0x00000002ULL
@@ -83,9 +86,6 @@ constexpr uint64_t PROF_AICPU_MODEL_MASK = 0x4000000000000000ULL;
#define MSVP_PROF_API __attribute__((visibility("default"))) #define MSVP_PROF_API __attribute__((visibility("default")))
#endif #endif


#include <cstdint>
#include <cstddef>

namespace Msprofiler { namespace Msprofiler {
namespace Api { namespace Api {
/** /**


Loading…
Cancel
Save