mirror of
https://github.com/opencv/opencv.git
synced 2025-01-18 06:03:15 +08:00
fixed warnings in GPU samples
This commit is contained in:
parent
a42a42858c
commit
5f175f9594
@ -42,10 +42,13 @@ void destroyContexts();
|
|||||||
#define safeCall(expr) safeCall_(expr, #expr, __FILE__, __LINE__)
|
#define safeCall(expr) safeCall_(expr, #expr, __FILE__, __LINE__)
|
||||||
inline void safeCall_(int code, const char* expr, const char* file, int line)
|
inline void safeCall_(int code, const char* expr, const char* file, int line)
|
||||||
{
|
{
|
||||||
cout << "CUDA driver API error: code " << code << ", expr " << expr
|
if (code != CUDA_SUCCESS)
|
||||||
<< ", file " << file << ", line " << line << endl;
|
{
|
||||||
destroyContexts();
|
cout << "CUDA driver API error: code " << code << ", expr " << expr
|
||||||
exit(-1);
|
<< ", file " << file << ", line " << line << endl;
|
||||||
|
destroyContexts();
|
||||||
|
exit(-1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Each GPU is associated with its own context
|
// Each GPU is associated with its own context
|
||||||
|
@ -44,10 +44,13 @@ void destroyContexts();
|
|||||||
#define safeCall(expr) safeCall_(expr, #expr, __FILE__, __LINE__)
|
#define safeCall(expr) safeCall_(expr, #expr, __FILE__, __LINE__)
|
||||||
inline void safeCall_(int code, const char* expr, const char* file, int line)
|
inline void safeCall_(int code, const char* expr, const char* file, int line)
|
||||||
{
|
{
|
||||||
cout << "CUDA driver API error: code " << code << ", expr " << expr
|
if (code != CUDA_SUCCESS)
|
||||||
<< ", file " << file << ", line " << line << endl;
|
{
|
||||||
destroyContexts();
|
cout << "CUDA driver API error: code " << code << ", expr " << expr
|
||||||
exit(-1);
|
<< ", file " << file << ", line " << line << endl;
|
||||||
|
destroyContexts();
|
||||||
|
exit(-1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Each GPU is associated with its own context
|
// Each GPU is associated with its own context
|
||||||
|
Loading…
Reference in New Issue
Block a user