Browse Source

!10487 Fix warning info

From: @lizhenglong1992
Reviewed-by: @pandoublefeng,@heleiwang
Signed-off-by: @liucunwei
tags/v1.2.0-rc1
mindspore-ci-bot Gitee 5 years ago
parent
commit
724ded7ad2
6 changed files with 9 additions and 17 deletions
  1. +0
    -1
      mindspore/ccsrc/minddata/dataset/kernels/image/dvpp/utils/AclProcess.h
  2. +0
    -6
      mindspore/ccsrc/minddata/dataset/kernels/image/dvpp/utils/DvppCommon.cc
  3. +2
    -3
      mindspore/ccsrc/minddata/dataset/kernels/image/dvpp/utils/ErrorCode.cpp
  4. +2
    -2
      mindspore/ccsrc/minddata/dataset/kernels/image/dvpp/utils/ErrorCode.h
  5. +4
    -4
      mindspore/ccsrc/minddata/dataset/kernels/image/dvpp/utils/ResourceManager.cc
  6. +1
    -1
      mindspore/ccsrc/minddata/dataset/kernels/image/dvpp/utils/ResourceManager.h

+ 0
- 1
mindspore/ccsrc/minddata/dataset/kernels/image/dvpp/utils/AclProcess.h View File

@@ -24,7 +24,6 @@
#include <string>
#include <map>
#include <climits>
#include <string>
#include <iostream>
#include <memory>
#include "acl/acl.h"


+ 0
- 6
mindspore/ccsrc/minddata/dataset/kernels/image/dvpp/utils/DvppCommon.cc View File

@@ -983,12 +983,6 @@ APP_ERROR DvppCommon::CombineJpegdProcess(const RawData &imageInfo, acldvppPixel
* @return: APP_ERR_OK if success, other values if failure
*/
APP_ERROR DvppCommon::TransferImageH2D(const RawData &imageInfo, const std::shared_ptr<DvppDataInfo> &jpegInput) {
// Check image buffer size validity
if (imageInfo.lenOfByte <= 0) {
MS_LOG(ERROR) << "The input buffer size on host should not be empty.";
return APP_ERR_COMM_INVALID_PARAM;
}

uint8_t *inDevBuff = nullptr;
APP_ERROR ret = acldvppMalloc((void **)&inDevBuff, imageInfo.lenOfByte);
if (ret != APP_ERR_OK) {


+ 2
- 3
mindspore/ccsrc/minddata/dataset/kernels/image/dvpp/utils/ErrorCode.cpp View File

@@ -37,14 +37,13 @@ std::string GetAppErrCodeInfo(const APP_ERROR err) {
}
}
void AssertErrorCode(const int code, const std::string file, const std::string function, const int line) {
void AssertErrorCode(const int code, const std::string &file, const std::string &function, const int line) {
if (code != APP_ERR_OK) {
MS_LOG(ERROR) << "Failed at " << file << "->" << function << "->" << line << ": error code=" << code;
exit(code);
}
}
void CheckErrorCode(const int code, const std::string file, const std::string function, const int line) {
void CheckErrorCode(const int code, const std::string &file, const std::string &function, const int line) {
if (code != APP_ERR_OK) {
MS_LOG(ERROR) << "Failed at " << file << "->" << function << "->" << line << ": error code=" << code;
}


+ 2
- 2
mindspore/ccsrc/minddata/dataset/kernels/image/dvpp/utils/ErrorCode.h View File

@@ -249,8 +249,8 @@ const std::string APP_ERR_FACE_LOG_STRING[] = {
};
std::string GetAppErrCodeInfo(APP_ERROR err);
void AssertErrorCode(const int code, const std::string file, const std::string function, const int line);
void CheckErrorCode(const int code, const std::string file, const std::string function, const int line);
void AssertErrorCode(const int code, const std::string &file, const std::string &function, const int line);
void CheckErrorCode(const int code, const std::string &file, const std::string &function, const int line);
#define RtAssert(code) AssertErrorCode(code, __FILE__, __FUNCTION__, __LINE__);
#define RtCheckError(code) CheckErrorCode(code, __FILE__, __FUNCTION__, __LINE__);


+ 4
- 4
mindspore/ccsrc/minddata/dataset/kernels/image/dvpp/utils/ResourceManager.cc View File

@@ -29,15 +29,15 @@ std::shared_ptr<ResourceManager> ResourceManager::ptr_ = nullptr;
*/
APP_ERROR ExistFile(const std::string &filePath) {
struct stat fileSat = {0};
char c[PATH_MAX + 1] = {0x00};
size_t count = filePath.copy(c, PATH_MAX + 1);
char c[PATH_MAX_ASCEND + 1] = {0x00};
size_t count = filePath.copy(c, PATH_MAX_ASCEND + 1);
if (count != filePath.length()) {
MS_LOG(ERROR) << "Failed to strcpy" << c;
return APP_ERR_COMM_FAILURE;
}
// Get the absolute path of input directory
char path[PATH_MAX + 1] = {0x00};
if ((strlen(c) > PATH_MAX) || (realpath(c, path) == nullptr)) {
char path[PATH_MAX_ASCEND + 1] = {0x00};
if ((strlen(c) > PATH_MAX_ASCEND) || (realpath(c, path) == nullptr)) {
MS_LOG(ERROR) << "Failed to get canonicalize path";
return APP_ERR_COMM_EXIST;
}


+ 1
- 1
mindspore/ccsrc/minddata/dataset/kernels/image/dvpp/utils/ResourceManager.h View File

@@ -29,7 +29,7 @@
#include "mindspore/core/utils/log_adapter.h"
#include "mindspore/ccsrc/cxx_api/graph/acl/acl_env_guard.h"

#define PATH_MAX 4096
#define PATH_MAX_ASCEND 4096

enum ModelLoadMethod {
LOAD_FROM_FILE = 0, // Loading from file, memory of model and weights are managed by ACL


Loading…
Cancel
Save