add fucntion to control tegra optimizations in run-time

This commit is contained in:
Vladislav Vinogradov
2015-02-26 19:34:20 +03:00
parent f73c6e6147
commit f8484e3266
3 changed files with 45 additions and 0 deletions

View File

@@ -1257,6 +1257,36 @@ void setUseIPP(bool flag)
} // namespace ipp
#ifdef HAVE_TEGRA_OPTIMIZATION
namespace tegra {
bool useTegra()
{
CoreTLSData* data = getCoreTlsData().get();
if (data->useTegra < 0)
{
const char* pTegraEnv = getenv("OPENCV_TEGRA");
if (pTegraEnv && (cv::String(pTegraEnv) == "disabled"))
data->useTegra = false;
else
data->useTegra = true;
}
return (data->useTegra > 0);
}
void setUseTegra(bool flag)
{
CoreTLSData* data = getCoreTlsData().get();
data->useTegra = flag;
}
} // namespace tegra
#endif
} // namespace cv
/* End of file. */