Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix GetErrorSumaryString #61997

Merged
merged 1 commit into from
Feb 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions paddle/cinn/utils/error.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ inline std::string demangle(std::string name) {
inline std::string demangle(std::string name) { return name; }
#endif

static std::string GetErrorSumaryString(const std::string& what,
const char* file,
int line) {
static std::string GetErrorSummaryString(const std::string& what,
const char* file,
int line) {
std::ostringstream sout;
sout << "\n----------------------\nError Message "
"Summary:\n----------------------\n";
Expand Down Expand Up @@ -99,7 +99,7 @@ static std::string GetCurrentTraceBackString() {
static std::string GetTraceBackString(const std::string& what,
const char* file,
int line) {
return GetCurrentTraceBackString() + GetErrorSumaryString(what, file, line);
return GetCurrentTraceBackString() + GetErrorSummaryString(what, file, line);
}

struct EnforceNotMet : public std::exception {
Expand Down
10 changes: 5 additions & 5 deletions paddle/common/enforce.h
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,9 @@ TEST_API int GetCallStackLevel();
TEST_API std::string SimplifyErrorTypeFormat(const std::string& str);
TEST_API std::string GetCurrentTraceBackString(bool for_signal = false);
template <typename StrType>
static std::string GetErrorSumaryString(StrType&& what,
const char* file,
int line) {
static std::string GetErrorSummaryString(StrType&& what,
const char* file,
int line) {
std::ostringstream sout;
if (GetCallStackLevel() > 1) {
sout << "\n----------------------\nError Message "
Expand All @@ -139,9 +139,9 @@ static std::string GetTraceBackString(StrType&& what,
if (GetCallStackLevel() > 1) {
// FLAGS_call_stack_level>1 means showing c++ call stack
return ::common::enforce::GetCurrentTraceBackString() +
GetErrorSumaryString(what, file, line);
GetErrorSummaryString(what, file, line);
} else {
return GetErrorSumaryString(what, file, line);
return GetErrorSummaryString(what, file, line);
}
}

Expand Down