fixed warnings in GPU samples
This commit is contained in:
@@ -41,12 +41,15 @@ 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)
|
||||||
|
{
|
||||||
|
if (code != CUDA_SUCCESS)
|
||||||
{
|
{
|
||||||
cout << "CUDA driver API error: code " << code << ", expr " << expr
|
cout << "CUDA driver API error: code " << code << ", expr " << expr
|
||||||
<< ", file " << file << ", line " << line << endl;
|
<< ", file " << file << ", line " << line << endl;
|
||||||
destroyContexts();
|
destroyContexts();
|
||||||
exit(-1);
|
exit(-1);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Each GPU is associated with its own context
|
// Each GPU is associated with its own context
|
||||||
CUcontext contexts[2];
|
CUcontext contexts[2];
|
||||||
|
@@ -43,12 +43,15 @@ 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)
|
||||||
|
{
|
||||||
|
if (code != CUDA_SUCCESS)
|
||||||
{
|
{
|
||||||
cout << "CUDA driver API error: code " << code << ", expr " << expr
|
cout << "CUDA driver API error: code " << code << ", expr " << expr
|
||||||
<< ", file " << file << ", line " << line << endl;
|
<< ", file " << file << ", line " << line << endl;
|
||||||
destroyContexts();
|
destroyContexts();
|
||||||
exit(-1);
|
exit(-1);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Each GPU is associated with its own context
|
// Each GPU is associated with its own context
|
||||||
CUcontext contexts[2];
|
CUcontext contexts[2];
|
||||||
|
Reference in New Issue
Block a user