mirror of
https://github.com/opencv/opencv.git
synced 2026-07-30 07:43:03 +04:00
renamed gpu namespace -> cuda
This commit is contained in:
@@ -65,8 +65,8 @@ namespace cvtest
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// GpuMat create
|
||||
|
||||
CV_EXPORTS cv::gpu::GpuMat createMat(cv::Size size, int type, bool useRoi = false);
|
||||
CV_EXPORTS cv::gpu::GpuMat loadMat(const cv::Mat& m, bool useRoi = false);
|
||||
CV_EXPORTS cv::cuda::GpuMat createMat(cv::Size size, int type, bool useRoi = false);
|
||||
CV_EXPORTS cv::cuda::GpuMat loadMat(const cv::Mat& m, bool useRoi = false);
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Image load
|
||||
@@ -81,7 +81,7 @@ namespace cvtest
|
||||
// Gpu devices
|
||||
|
||||
//! return true if device supports specified feature and gpu module was built with support the feature.
|
||||
CV_EXPORTS bool supportFeature(const cv::gpu::DeviceInfo& info, cv::gpu::FeatureSet feature);
|
||||
CV_EXPORTS bool supportFeature(const cv::cuda::DeviceInfo& info, cv::cuda::FeatureSet feature);
|
||||
|
||||
class CV_EXPORTS DeviceManager
|
||||
{
|
||||
@@ -91,10 +91,10 @@ namespace cvtest
|
||||
void load(int i);
|
||||
void loadAll();
|
||||
|
||||
const std::vector<cv::gpu::DeviceInfo>& values() const { return devices_; }
|
||||
const std::vector<cv::cuda::DeviceInfo>& values() const { return devices_; }
|
||||
|
||||
private:
|
||||
std::vector<cv::gpu::DeviceInfo> devices_;
|
||||
std::vector<cv::cuda::DeviceInfo> devices_;
|
||||
};
|
||||
|
||||
#define ALL_DEVICES testing::ValuesIn(cvtest::DeviceManager::instance().values())
|
||||
@@ -201,7 +201,7 @@ namespace cvtest
|
||||
} \
|
||||
catch (...) \
|
||||
{ \
|
||||
cv::gpu::resetDevice(); \
|
||||
cv::cuda::resetDevice(); \
|
||||
throw; \
|
||||
} \
|
||||
} \
|
||||
@@ -342,7 +342,7 @@ namespace cvtest
|
||||
CV_EXPORTS void printCudaInfo();
|
||||
}
|
||||
|
||||
namespace cv { namespace gpu
|
||||
namespace cv { namespace cuda
|
||||
{
|
||||
CV_EXPORTS void PrintTo(const DeviceInfo& info, std::ostream* os);
|
||||
}}
|
||||
@@ -378,7 +378,7 @@ namespace cv { namespace gpu
|
||||
else \
|
||||
{ \
|
||||
cvtest::DeviceManager::instance().load(device); \
|
||||
cv::gpu::DeviceInfo info(device); \
|
||||
cv::cuda::DeviceInfo info(device); \
|
||||
std::cout << "Run tests on device " << device << " [" << info.name() << "] \n" << std::endl; \
|
||||
} \
|
||||
cvtest::TS::ptr()->init( resourcesubdir ); \
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
#endif
|
||||
|
||||
// declare major namespaces to avoid errors on unknown namespace
|
||||
namespace cv { namespace gpu {} namespace ocl {} }
|
||||
namespace cv { namespace cuda {} namespace ocl {} }
|
||||
|
||||
namespace perf
|
||||
{
|
||||
@@ -96,7 +96,7 @@ private:
|
||||
class_name(int val = 0) : val_(val) {} \
|
||||
operator int() const { return val_; } \
|
||||
void PrintTo(std::ostream* os) const { \
|
||||
using namespace cv;using namespace cv::gpu; using namespace cv::ocl; \
|
||||
using namespace cv;using namespace cv::cuda; using namespace cv::ocl; \
|
||||
const int vals[] = { __VA_ARGS__ }; \
|
||||
const char* svals = #__VA_ARGS__; \
|
||||
for(int i = 0, pos = 0; i < (int)(sizeof(vals)/sizeof(int)); ++i) { \
|
||||
@@ -112,7 +112,7 @@ private:
|
||||
*os << "UNKNOWN"; \
|
||||
} \
|
||||
static ::testing::internal::ParamGenerator<class_name> all() { \
|
||||
using namespace cv;using namespace cv::gpu; using namespace cv::ocl; \
|
||||
using namespace cv;using namespace cv::cuda; using namespace cv::ocl; \
|
||||
static class_name vals[] = { __VA_ARGS__ }; \
|
||||
return ::testing::ValuesIn(vals); \
|
||||
} \
|
||||
@@ -126,7 +126,7 @@ private:
|
||||
class_name(int val = 0) : val_(val) {} \
|
||||
operator int() const { return val_; } \
|
||||
void PrintTo(std::ostream* os) const { \
|
||||
using namespace cv;using namespace cv::gpu; using namespace cv::ocl; \
|
||||
using namespace cv;using namespace cv::cuda; using namespace cv::ocl; \
|
||||
const int vals[] = { __VA_ARGS__ }; \
|
||||
const char* svals = #__VA_ARGS__; \
|
||||
int value = val_; \
|
||||
|
||||
@@ -278,13 +278,13 @@ namespace perf
|
||||
printf("[----------]\n"), fflush(stdout);
|
||||
|
||||
printf("[----------]\n"), fflush(stdout);
|
||||
int deviceCount = cv::gpu::getCudaEnabledDeviceCount();
|
||||
int deviceCount = cv::cuda::getCudaEnabledDeviceCount();
|
||||
printf("[ GPU INFO ] \tCUDA device count:: %d.\n", deviceCount), fflush(stdout);
|
||||
printf("[----------]\n"), fflush(stdout);
|
||||
|
||||
for (int i = 0; i < deviceCount; ++i)
|
||||
{
|
||||
cv::gpu::DeviceInfo info(i);
|
||||
cv::cuda::DeviceInfo info(i);
|
||||
|
||||
printf("[----------]\n"), fflush(stdout);
|
||||
printf("[ DEVICE ] \t# %d %s.\n", i, info.name()), fflush(stdout);
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
#include <stdexcept>
|
||||
|
||||
using namespace cv;
|
||||
using namespace cv::gpu;
|
||||
using namespace cv::cuda;
|
||||
using namespace cvtest;
|
||||
using namespace testing;
|
||||
using namespace testing::internal;
|
||||
@@ -515,7 +515,7 @@ namespace cvtest
|
||||
}
|
||||
|
||||
|
||||
void cv::gpu::PrintTo(const DeviceInfo& info, std::ostream* os)
|
||||
void cv::cuda::PrintTo(const DeviceInfo& info, std::ostream* os)
|
||||
{
|
||||
(*os) << info.name();
|
||||
}
|
||||
|
||||
@@ -708,18 +708,18 @@ void TestBase::Init(const std::vector<std::string> & availableImpls,
|
||||
|
||||
#ifdef HAVE_CUDA
|
||||
|
||||
param_cuda_device = std::max(0, std::min(cv::gpu::getCudaEnabledDeviceCount(), args.get<int>("perf_cuda_device")));
|
||||
param_cuda_device = std::max(0, std::min(cv::cuda::getCudaEnabledDeviceCount(), args.get<int>("perf_cuda_device")));
|
||||
|
||||
if (param_impl == "cuda")
|
||||
{
|
||||
cv::gpu::DeviceInfo info(param_cuda_device);
|
||||
cv::cuda::DeviceInfo info(param_cuda_device);
|
||||
if (!info.isCompatible())
|
||||
{
|
||||
printf("[----------]\n[ FAILURE ] \tDevice %s is NOT compatible with current GPU module build.\n[----------]\n", info.name()), fflush(stdout);
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
cv::gpu::setDevice(param_cuda_device);
|
||||
cv::cuda::setDevice(param_cuda_device);
|
||||
|
||||
printf("[----------]\n[ GPU INFO ] \tRun test suite on %s GPU.\n[----------]\n", info.name()), fflush(stdout);
|
||||
}
|
||||
@@ -744,7 +744,7 @@ void TestBase::RecordRunParameters()
|
||||
#ifdef HAVE_CUDA
|
||||
if (param_impl == "cuda")
|
||||
{
|
||||
cv::gpu::DeviceInfo info(param_cuda_device);
|
||||
cv::cuda::DeviceInfo info(param_cuda_device);
|
||||
::testing::Test::RecordProperty("cv_cuda_gpu", info.name());
|
||||
}
|
||||
#endif
|
||||
@@ -1203,7 +1203,7 @@ void TestBase::RunPerfTestBody()
|
||||
metrics.terminationReason = performance_metrics::TERM_EXCEPTION;
|
||||
#ifdef HAVE_CUDA
|
||||
if (e.code == cv::Error::GpuApiCallError)
|
||||
cv::gpu::resetDevice();
|
||||
cv::cuda::resetDevice();
|
||||
#endif
|
||||
FAIL() << "Expected: PerfTestBody() doesn't throw an exception.\n Actual: it throws cv::Exception:\n " << e.what();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user