Commit 5f175f95 authored by Alexey Spizhevoy's avatar Alexey Spizhevoy

fixed warnings in GPU samples

parent a42a4285
...@@ -42,10 +42,13 @@ void destroyContexts(); ...@@ -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(); ...@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment