parent
f3a2656808
commit
cbb132ccb1
6 changed files with 151 additions and 115 deletions
@ -1,94 +1,94 @@ |
|||||||
/*M///////////////////////////////////////////////////////////////////////////////////////
|
/*M///////////////////////////////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
|
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
|
||||||
//
|
//
|
||||||
// By downloading, copying, installing or using the software you agree to this license.
|
// By downloading, copying, installing or using the software you agree to this license.
|
||||||
// If you do not agree to this license, do not download, install,
|
// If you do not agree to this license, do not download, install,
|
||||||
// copy or use the software.
|
// copy or use the software.
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
// Intel License Agreement
|
// Intel License Agreement
|
||||||
// For Open Source Computer Vision Library
|
// For Open Source Computer Vision Library
|
||||||
//
|
//
|
||||||
// Copyright (C) 2000, Intel Corporation, all rights reserved.
|
// Copyright (C) 2000, Intel Corporation, all rights reserved.
|
||||||
// Third party copyrights are property of their respective owners.
|
// Third party copyrights are property of their respective owners.
|
||||||
//
|
//
|
||||||
// Redistribution and use in source and binary forms, with or without modification,
|
// Redistribution and use in source and binary forms, with or without modification,
|
||||||
// are permitted provided that the following conditions are met:
|
// are permitted provided that the following conditions are met:
|
||||||
//
|
//
|
||||||
// * Redistribution's of source code must retain the above copyright notice,
|
// * Redistribution's of source code must retain the above copyright notice,
|
||||||
// this list of conditions and the following disclaimer.
|
// this list of conditions and the following disclaimer.
|
||||||
//
|
//
|
||||||
// * Redistribution's in binary form must reproduce the above copyright notice,
|
// * Redistribution's in binary form must reproduce the above copyright notice,
|
||||||
// this list of conditions and the following disclaimer in the documentation
|
// this list of conditions and the following disclaimer in the documentation
|
||||||
// and/or other materials provided with the distribution.
|
// and/or other materials provided with the distribution.
|
||||||
//
|
//
|
||||||
// * The name of Intel Corporation may not be used to endorse or promote products
|
// * The name of Intel Corporation may not be used to endorse or promote products
|
||||||
// derived from this software without specific prior written permission.
|
// derived from this software without specific prior written permission.
|
||||||
//
|
//
|
||||||
// This software is provided by the copyright holders and contributors "as is" and
|
// This software is provided by the copyright holders and contributors "as is" and
|
||||||
// any express or implied warranties, including, but not limited to, the implied
|
// any express or implied warranties, including, but not limited to, the implied
|
||||||
// warranties of merchantability and fitness for a particular purpose are disclaimed.
|
// warranties of merchantability and fitness for a particular purpose are disclaimed.
|
||||||
// In no event shall the Intel Corporation or contributors be liable for any direct,
|
// In no event shall the Intel Corporation or contributors be liable for any direct,
|
||||||
// indirect, incidental, special, exemplary, or consequential damages
|
// indirect, incidental, special, exemplary, or consequential damages
|
||||||
// (including, but not limited to, procurement of substitute goods or services;
|
// (including, but not limited to, procurement of substitute goods or services;
|
||||||
// loss of use, data, or profits; or business interruption) however caused
|
// loss of use, data, or profits; or business interruption) however caused
|
||||||
// and on any theory of liability, whether in contract, strict liability,
|
// and on any theory of liability, whether in contract, strict liability,
|
||||||
// or tort (including negligence or otherwise) arising in any way out of
|
// or tort (including negligence or otherwise) arising in any way out of
|
||||||
// the use of this software, even if advised of the possibility of such damage.
|
// the use of this software, even if advised of the possibility of such damage.
|
||||||
//
|
//
|
||||||
//M*/
|
//M*/
|
||||||
|
|
||||||
#ifndef _GPU_TEST_H_ |
#ifndef _GPU_TEST_H_ |
||||||
#define _GPU_TEST_H_ |
#define _GPU_TEST_H_ |
||||||
|
|
||||||
#if defined WIN32 || defined _WIN32 |
#if defined WIN32 || defined _WIN32 |
||||||
#include <windows.h> |
#include <windows.h> |
||||||
#undef min |
#undef min |
||||||
#undef max |
#undef max |
||||||
#endif |
#endif |
||||||
|
|
||||||
#include <opencv2/gpu/gpu.hpp> |
#include <opencv2/gpu/gpu.hpp> |
||||||
#include <opencv2/highgui/highgui.hpp> |
#include <opencv2/highgui/highgui.hpp> |
||||||
#include <opencv2/imgproc/imgproc.hpp> |
#include <opencv2/imgproc/imgproc.hpp> |
||||||
#include <opencv2/features2d/features2d.hpp> |
#include <opencv2/features2d/features2d.hpp> |
||||||
#include "cxts.h" |
#include "cxts.h" |
||||||
|
|
||||||
/****************************************************************************************/ |
/****************************************************************************************/ |
||||||
/* Warnings Disabling */ |
/* Warnings Disabling */ |
||||||
/****************************************************************************************/ |
/****************************************************************************************/ |
||||||
#if _MSC_VER > 1000 |
#if _MSC_VER > 1000 |
||||||
#pragma warning(disable : 4514) /* unreferenced inline function has been */ |
#pragma warning(disable : 4514) /* unreferenced inline function has been */ |
||||||
/* removed */ |
/* removed */ |
||||||
#pragma warning(disable : 4127) /* conditional expression is constant */ |
#pragma warning(disable : 4127) /* conditional expression is constant */ |
||||||
/* for no warnings in _ASSERT */ |
/* for no warnings in _ASSERT */ |
||||||
#pragma warning(disable : 4996) /* deprecated function */ |
#pragma warning(disable : 4996) /* deprecated function */ |
||||||
#endif |
#endif |
||||||
|
|
||||||
|
|
||||||
static inline bool check_and_treat_gpu_exception(const cv::Exception& e, CvTS* ts) |
static inline bool check_and_treat_gpu_exception(const cv::Exception& e, CvTS* ts) |
||||||
{ |
{ |
||||||
switch (e.code) |
switch (e.code) |
||||||
{ |
{ |
||||||
case CV_GpuNotSupported:
|
case CV_GpuNotSupported:
|
||||||
ts->printf(CvTS::LOG, "\nGpu not supported by the library");
|
ts->printf(CvTS::LOG, "\nGpu not supported by the library");
|
||||||
break; |
break; |
||||||
|
|
||||||
case CV_GpuApiCallError:
|
case CV_GpuApiCallError:
|
||||||
ts->printf(CvTS::LOG, "\nGPU Error: %s", e.what()); |
ts->printf(CvTS::LOG, "\nGPU Error: %s", e.what()); |
||||||
break; |
break; |
||||||
|
|
||||||
case CV_GpuNppCallError:
|
case CV_GpuNppCallError:
|
||||||
ts->printf(CvTS::LOG, "\nNPP Error: %s", e.what()); |
ts->printf(CvTS::LOG, "\nNPP Error: %s", e.what()); |
||||||
break; |
break; |
||||||
|
|
||||||
default: |
default: |
||||||
return false; |
return false; |
||||||
} |
} |
||||||
ts->set_failed_test_info(CvTS::FAIL_GENERIC);
|
ts->set_failed_test_info(CvTS::FAIL_GENERIC);
|
||||||
return true; |
return true; |
||||||
} |
} |
||||||
|
|
||||||
#endif |
#endif |
||||||
|
|
||||||
/* End of file. */ |
/* End of file. */ |
||||||
|
Loading…
Reference in new issue