This commit is contained in:
@@ -16,11 +16,11 @@
|
||||
int main()
|
||||
{
|
||||
#if !defined(HAVE_CUDA)
|
||||
cout << "CUDA support is required (CMake key 'WITH_CUDA' must be true).\n";
|
||||
std::cout << "CUDA support is required (CMake key 'WITH_CUDA' must be true).\n";
|
||||
#endif
|
||||
|
||||
#if !defined(HAVE_TBB)
|
||||
cout << "TBB support is required (CMake key 'WITH_TBB' must be true).\n";
|
||||
std::cout << "TBB support is required (CMake key 'WITH_TBB' must be true).\n";
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
@@ -44,7 +44,7 @@ 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
|
||||
std::cout << "CUDA driver API error: code " << code << ", expr " << expr
|
||||
<< ", file " << file << ", line " << line << endl;
|
||||
destroyContexts();
|
||||
exit(-1);
|
||||
@@ -59,7 +59,7 @@ int main()
|
||||
int num_devices = getCudaEnabledDeviceCount();
|
||||
if (num_devices < 2)
|
||||
{
|
||||
cout << "Two or more GPUs are required\n";
|
||||
std::cout << "Two or more GPUs are required\n";
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -68,7 +68,7 @@ int main()
|
||||
DeviceInfo dev_info(i);
|
||||
if (!dev_info.isCompatible())
|
||||
{
|
||||
cout << "GPU module isn't built for GPU #" << i << " ("
|
||||
std::cout << "GPU module isn't built for GPU #" << i << " ("
|
||||
<< dev_info.name() << ", CC " << dev_info.majorVersion()
|
||||
<< dev_info.minorVersion() << "\n";
|
||||
return -1;
|
||||
@@ -122,7 +122,7 @@ void Worker::operator()(int device_id) const
|
||||
|
||||
// Check results
|
||||
bool passed = norm(dst - Mat(d_dst), NORM_INF) < 1e-3;
|
||||
cout << "GPU #" << device_id << " (" << DeviceInfo().name() << "): "
|
||||
std::cout << "GPU #" << device_id << " (" << DeviceInfo().name() << "): "
|
||||
<< (passed ? "passed" : "FAILED") << endl;
|
||||
|
||||
// Deallocate data here, otherwise deallocation will be performed
|
||||
|
@@ -18,11 +18,11 @@
|
||||
int main()
|
||||
{
|
||||
#if !defined(HAVE_CUDA)
|
||||
cout << "CUDA support is required (CMake key 'WITH_CUDA' must be true).\n";
|
||||
std::cout << "CUDA support is required (CMake key 'WITH_CUDA' must be true).\n";
|
||||
#endif
|
||||
|
||||
#if !defined(HAVE_TBB)
|
||||
cout << "TBB support is required (CMake key 'WITH_TBB' must be true).\n";
|
||||
std::cout << "TBB support is required (CMake key 'WITH_TBB' must be true).\n";
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
@@ -46,7 +46,7 @@ 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
|
||||
std::cout << "CUDA driver API error: code " << code << ", expr " << expr
|
||||
<< ", file " << file << ", line " << line << endl;
|
||||
destroyContexts();
|
||||
exit(-1);
|
||||
@@ -80,14 +80,14 @@ int main(int argc, char** argv)
|
||||
{
|
||||
if (argc < 3)
|
||||
{
|
||||
cout << "Usage: stereo_multi_gpu <left_image> <right_image>\n";
|
||||
std::cout << "Usage: stereo_multi_gpu <left_image> <right_image>\n";
|
||||
return -1;
|
||||
}
|
||||
|
||||
int num_devices = getCudaEnabledDeviceCount();
|
||||
if (num_devices < 2)
|
||||
{
|
||||
cout << "Two or more GPUs are required\n";
|
||||
std::cout << "Two or more GPUs are required\n";
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -96,7 +96,7 @@ int main(int argc, char** argv)
|
||||
DeviceInfo dev_info(i);
|
||||
if (!dev_info.isCompatible())
|
||||
{
|
||||
cout << "GPU module isn't built for GPU #" << i << " ("
|
||||
std::cout << "GPU module isn't built for GPU #" << i << " ("
|
||||
<< dev_info.name() << ", CC " << dev_info.majorVersion()
|
||||
<< dev_info.minorVersion() << "\n";
|
||||
return -1;
|
||||
@@ -108,12 +108,12 @@ int main(int argc, char** argv)
|
||||
Mat right = imread(argv[2], CV_LOAD_IMAGE_GRAYSCALE);
|
||||
if (left.empty())
|
||||
{
|
||||
cout << "Cannot open '" << argv[1] << "'\n";
|
||||
std::cout << "Cannot open '" << argv[1] << "'\n";
|
||||
return -1;
|
||||
}
|
||||
if (right.empty())
|
||||
{
|
||||
cout << "Cannot open '" << argv[2] << "'\n";
|
||||
std::cout << "Cannot open '" << argv[2] << "'\n";
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -180,7 +180,7 @@ void Worker::operator()(int device_id) const
|
||||
bm[device_id]->operator()(d_left[device_id], d_right[device_id],
|
||||
d_result[device_id]);
|
||||
|
||||
cout << "GPU #" << device_id << " (" << DeviceInfo().name()
|
||||
std::cout << "GPU #" << device_id << " (" << DeviceInfo().name()
|
||||
<< "): finished\n";
|
||||
|
||||
contextOff();
|
||||
|
@@ -16,11 +16,11 @@
|
||||
int main()
|
||||
{
|
||||
#if !defined(HAVE_CUDA)
|
||||
cout << "CUDA support is required (CMake key 'WITH_CUDA' must be true).\n";
|
||||
std::cout << "CUDA support is required (CMake key 'WITH_CUDA' must be true).\n";
|
||||
#endif
|
||||
|
||||
#if !defined(HAVE_TBB)
|
||||
cout << "TBB support is required (CMake key 'WITH_TBB' must be true).\n";
|
||||
std::cout << "TBB support is required (CMake key 'WITH_TBB' must be true).\n";
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
@@ -43,7 +43,7 @@ int main()
|
||||
int num_devices = getCudaEnabledDeviceCount();
|
||||
if (num_devices < 2)
|
||||
{
|
||||
cout << "Two or more GPUs are required\n";
|
||||
std::cout << "Two or more GPUs are required\n";
|
||||
return -1;
|
||||
}
|
||||
for (int i = 0; i < num_devices; ++i)
|
||||
@@ -51,7 +51,7 @@ int main()
|
||||
DeviceInfo dev_info(i);
|
||||
if (!dev_info.isCompatible())
|
||||
{
|
||||
cout << "GPU module isn't built for GPU #" << i << " ("
|
||||
std::cout << "GPU module isn't built for GPU #" << i << " ("
|
||||
<< dev_info.name() << ", CC " << dev_info.majorVersion()
|
||||
<< dev_info.minorVersion() << "\n";
|
||||
return -1;
|
||||
@@ -88,7 +88,7 @@ void Worker::operator()(int device_id) const
|
||||
|
||||
// Check results
|
||||
bool passed = norm(dst - Mat(d_dst), NORM_INF) < 1e-3;
|
||||
cout << "GPU #" << device_id << " (" << DeviceInfo().name() << "): "
|
||||
std::cout << "GPU #" << device_id << " (" << DeviceInfo().name() << "): "
|
||||
<< (passed ? "passed" : "FAILED") << endl;
|
||||
|
||||
// Deallocate data here, otherwise deallocation will be performed
|
||||
|
@@ -18,11 +18,11 @@
|
||||
int main()
|
||||
{
|
||||
#if !defined(HAVE_CUDA)
|
||||
cout << "CUDA support is required (CMake key 'WITH_CUDA' must be true).\n";
|
||||
std::cout << "CUDA support is required (CMake key 'WITH_CUDA' must be true).\n";
|
||||
#endif
|
||||
|
||||
#if !defined(HAVE_TBB)
|
||||
cout << "TBB support is required (CMake key 'WITH_TBB' must be true).\n";
|
||||
std::cout << "TBB support is required (CMake key 'WITH_TBB' must be true).\n";
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
@@ -53,14 +53,14 @@ int main(int argc, char** argv)
|
||||
{
|
||||
if (argc < 3)
|
||||
{
|
||||
cout << "Usage: stereo_multi_gpu <left_image> <right_image>\n";
|
||||
std::cout << "Usage: stereo_multi_gpu <left_image> <right_image>\n";
|
||||
return -1;
|
||||
}
|
||||
|
||||
int num_devices = getCudaEnabledDeviceCount();
|
||||
if (num_devices < 2)
|
||||
{
|
||||
cout << "Two or more GPUs are required\n";
|
||||
std::cout << "Two or more GPUs are required\n";
|
||||
return -1;
|
||||
}
|
||||
for (int i = 0; i < num_devices; ++i)
|
||||
@@ -68,7 +68,7 @@ int main(int argc, char** argv)
|
||||
DeviceInfo dev_info(i);
|
||||
if (!dev_info.isCompatible())
|
||||
{
|
||||
cout << "GPU module isn't built for GPU #" << i << " ("
|
||||
std::cout << "GPU module isn't built for GPU #" << i << " ("
|
||||
<< dev_info.name() << ", CC " << dev_info.majorVersion()
|
||||
<< dev_info.minorVersion() << "\n";
|
||||
return -1;
|
||||
@@ -80,12 +80,12 @@ int main(int argc, char** argv)
|
||||
Mat right = imread(argv[2], CV_LOAD_IMAGE_GRAYSCALE);
|
||||
if (left.empty())
|
||||
{
|
||||
cout << "Cannot open '" << argv[1] << "'\n";
|
||||
std::cout << "Cannot open '" << argv[1] << "'\n";
|
||||
return -1;
|
||||
}
|
||||
if (right.empty())
|
||||
{
|
||||
cout << "Cannot open '" << argv[2] << "'\n";
|
||||
std::cout << "Cannot open '" << argv[2] << "'\n";
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -139,7 +139,7 @@ void Worker::operator()(int device_id) const
|
||||
bm[device_id]->operator()(d_left[device_id], d_right[device_id],
|
||||
d_result[device_id]);
|
||||
|
||||
cout << "GPU #" << device_id << " (" << DeviceInfo().name()
|
||||
std::cout << "GPU #" << device_id << " (" << DeviceInfo().name()
|
||||
<< "): finished\n";
|
||||
|
||||
multi_gpu_mgr.gpuOff();
|
||||
|
Reference in New Issue
Block a user