From 593fae4c0279030d128fdf39c471f2a1ea70fdb6 Mon Sep 17 00:00:00 2001 From: Alexey Spizhevoy Date: Thu, 10 Feb 2011 14:33:02 +0000 Subject: [PATCH] minor chnages in GPU samples --- samples/gpu/multi.cpp | 2 +- samples/gpu/performance/performance.h | 4 ++-- samples/gpu/stereo_multi.cpp | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/samples/gpu/multi.cpp b/samples/gpu/multi.cpp index aea4021cc0..94fcb86654 100644 --- a/samples/gpu/multi.cpp +++ b/samples/gpu/multi.cpp @@ -50,7 +50,6 @@ CUcontext contexts[2]; int main() { int num_devices = getCudaEnabledDeviceCount(); - if (num_devices < 2) { cout << "Two or more GPUs are required\n"; @@ -69,6 +68,7 @@ int main() } } + // Init CUDA Driver API safeCall(cuInit(0)); // Create context for GPU #0 diff --git a/samples/gpu/performance/performance.h b/samples/gpu/performance/performance.h index fccb561be0..4d5283d51b 100644 --- a/samples/gpu/performance/performance.h +++ b/samples/gpu/performance/performance.h @@ -71,7 +71,7 @@ public: private: TestSystem(): can_flush_(false), cpu_elapsed_(0), gpu_elapsed_(0), - speedup_total_(0.0), num_subtests_called_(0) {}; + speedup_total_(0.0), num_subtests_called_(0) {} void flushSubtestData(); @@ -135,4 +135,4 @@ void gen(cv::Mat& mat, int rows, int cols, int type, cv::Scalar low, std::string abspath(const std::string& relpath); -#endif // OPENCV_GPU_SAMPLE_PERFORMANCE_H_ \ No newline at end of file +#endif // OPENCV_GPU_SAMPLE_PERFORMANCE_H_ diff --git a/samples/gpu/stereo_multi.cpp b/samples/gpu/stereo_multi.cpp index 58d88c6cf7..543d964e03 100644 --- a/samples/gpu/stereo_multi.cpp +++ b/samples/gpu/stereo_multi.cpp @@ -78,7 +78,6 @@ int main(int argc, char** argv) } int num_devices = getCudaEnabledDeviceCount(); - if (num_devices < 2) { cout << "Two or more GPUs are required\n"; @@ -111,6 +110,7 @@ int main(int argc, char** argv) return -1; } + // Init CUDA Driver API safeCall(cuInit(0)); // Create context for the first GPU