fixed GPU samples and MultiGpuMgr

This commit is contained in:
Alexey Spizhevoy
2011-02-14 15:09:45 +00:00
parent 6ce1c0e27c
commit a42a42858c
4 changed files with 15 additions and 39 deletions

View File

@@ -39,11 +39,13 @@ using namespace cv::gpu;
struct Worker { void operator()(int device_id) const; };
void destroyContexts();
#define safeCall(code) if (code != CUDA_SUCCESS) { \
cout << "CUDA driver API error: code " << code \
<< ", file " << __FILE__ << ", line " << __LINE__ << endl; \
destroyContexts(); \
exit(-1); \
#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);
}
// Each GPU is associated with its own context

View File

@@ -41,11 +41,13 @@ using namespace cv::gpu;
struct Worker { void operator()(int device_id) const; };
void destroyContexts();
#define safeCall(code) if (code != CUDA_SUCCESS) { \
cout << "CUDA driver API error: code " << code \
<< ", file " << __FILE__ << ", line " << __LINE__ << endl; \
destroyContexts(); \
exit(-1); \
#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);
}
// Each GPU is associated with its own context