move tegra namespace out of cv to prevent conflicts

This commit is contained in:
Vladislav Vinogradov
2015-02-27 12:52:11 +03:00
parent d696fac8b8
commit cda6fed41f
22 changed files with 48 additions and 45 deletions

View File

@@ -2256,7 +2256,7 @@ void cv::subtract( InputArray _src1, InputArray _src2, OutputArray _dst,
InputArray mask, int dtype )
{
#ifdef HAVE_TEGRA_OPTIMIZATION
if (cv::tegra::useTegra())
if (tegra::useTegra())
{
int kind1 = _src1.kind(), kind2 = _src2.kind();
Mat src1 = _src1.getMat(), src2 = _src2.getMat();

View File

@@ -127,7 +127,7 @@ static void FastAtan2_32f(const float *Y, const float *X, float *angle, int len,
float scale = angleInDegrees ? 1 : (float)(CV_PI/180);
#ifdef HAVE_TEGRA_OPTIMIZATION
if (cv::tegra::useTegra() && tegra::FastAtan2_32f(Y, X, angle, len, scale))
if (tegra::useTegra() && tegra::FastAtan2_32f(Y, X, angle, len, scale))
return;
#endif

View File

@@ -1257,13 +1257,15 @@ void setUseIPP(bool flag)
} // namespace ipp
} // namespace cv
#ifdef HAVE_TEGRA_OPTIMIZATION
namespace tegra {
bool useTegra()
{
CoreTLSData* data = getCoreTlsData().get();
cv::CoreTLSData* data = cv::getCoreTlsData().get();
if (data->useTegra < 0)
{
@@ -1279,7 +1281,7 @@ bool useTegra()
void setUseTegra(bool flag)
{
CoreTLSData* data = getCoreTlsData().get();
cv::CoreTLSData* data = cv::getCoreTlsData().get();
data->useTegra = flag;
}
@@ -1287,12 +1289,14 @@ void setUseTegra(bool flag)
#endif
namespace cv {
void setOptimizations(bool enabled)
{
cv::ipp::setUseIPP(enabled);
cv::ocl::setUseOpenCL(enabled);
ipp::setUseIPP(enabled);
ocl::setUseOpenCL(enabled);
#ifdef HAVE_TEGRA_OPTIMIZATION
cv::tegra::setUseTegra(enabled);
::tegra::setUseTegra(enabled);
#endif
}