fixed gpu module compilation
This commit is contained in:
@@ -51,7 +51,7 @@ namespace
|
||||
struct ErrorEntry
|
||||
{
|
||||
int code;
|
||||
String str;
|
||||
const char* str;
|
||||
};
|
||||
|
||||
class ErrorEntryComparer
|
||||
@@ -65,16 +65,14 @@ namespace
|
||||
int code_;
|
||||
};
|
||||
|
||||
String getErrorString(int code, const ErrorEntry* errors, size_t n)
|
||||
cv::String getErrorString(int code, const ErrorEntry* errors, size_t n)
|
||||
{
|
||||
size_t idx = std::find_if(errors, errors + n, ErrorEntryComparer(code)) - errors;
|
||||
|
||||
const String& msg = (idx != n) ? errors[idx].str : String("Unknown error code");
|
||||
const char* msg = (idx != n) ? errors[idx].str : "Unknown error code";
|
||||
cv::String str = cv::format("%s [Code = %d]", msg, code);
|
||||
|
||||
std::ostringstream ostr;
|
||||
ostr << msg << " [Code = " << code << "]";
|
||||
|
||||
return ostr.str();
|
||||
return str;
|
||||
}
|
||||
|
||||
const ErrorEntry cu_errors [] =
|
||||
@@ -131,7 +129,7 @@ namespace
|
||||
const size_t cu_errors_num = sizeof(cu_errors) / sizeof(cu_errors[0]);
|
||||
}
|
||||
|
||||
String cv::gpu::detail::cuGetErrString(CUresult res)
|
||||
cv::String cv::gpu::detail::cuGetErrString(CUresult res)
|
||||
{
|
||||
return getErrorString(res, cu_errors, cu_errors_num);
|
||||
}
|
||||
|
Reference in New Issue
Block a user