fixed warnings in GPU samples

This commit is contained in:
Alexey Spizhevoy 2011-02-14 15:36:07 +00:00
parent a42a42858c
commit 5f175f9594
2 changed files with 14 additions and 8 deletions

View File

@ -42,10 +42,13 @@ void destroyContexts();
#define safeCall(expr) safeCall_(expr, #expr, __FILE__, __LINE__)
inline void safeCall_(int code, const char* expr, const char* file, int line)
{
cout << "CUDA driver API error: code " << code << ", expr " << expr
<< ", file " << file << ", line " << line << endl;
destroyContexts();
exit(-1);
if (code != CUDA_SUCCESS)
{
cout << "CUDA driver API error: code " << code << ", expr " << expr
<< ", file " << file << ", line " << line << endl;
destroyContexts();
exit(-1);
}
}
// Each GPU is associated with its own context

View File

@ -44,10 +44,13 @@ void destroyContexts();
#define safeCall(expr) safeCall_(expr, #expr, __FILE__, __LINE__)
inline void safeCall_(int code, const char* expr, const char* file, int line)
{
cout << "CUDA driver API error: code " << code << ", expr " << expr
<< ", file " << file << ", line " << line << endl;
destroyContexts();
exit(-1);
if (code != CUDA_SUCCESS)
{
cout << "CUDA driver API error: code " << code << ", expr " << expr
<< ", file " << file << ", line " << line << endl;
destroyContexts();
exit(-1);
}
}
// Each GPU is associated with its own context