perf_precomp.hpp 3.8 KB
Newer Older
N
niko 已提交
1 2 3 4 5 6 7 8 9
/*M///////////////////////////////////////////////////////////////////////////////////////
//
//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
//  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,
//  copy or use the software.
//
//
Y
yao 已提交
10
//                           License Agreement
N
niko 已提交
11 12
//                For Open Source Computer Vision Library
//
Y
yao 已提交
13 14
// Copyright (C) 2010-2012, Multicoreware, Inc., all rights reserved.
// Copyright (C) 2010-2012, Advanced Micro Devices, Inc., all rights reserved.
N
niko 已提交
15
// Third party copyrights are property of their respective owners.
Y
yao 已提交
16

N
niko 已提交
17 18 19 20 21 22 23 24
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
//   * Redistribution's of source code must retain the above copyright notice,
//     this list of conditions and the following disclaimer.
//
//   * Redistribution's in binary form must reproduce the above copyright notice,
//     this list of conditions and the following disclaimer in the documentation
Y
yao 已提交
25
//     and/or other oclMaterials provided with the distribution.
N
niko 已提交
26
//
Y
yao 已提交
27
//   * The name of the copyright holders may not be used to endorse or promote products
N
niko 已提交
28 29
//     derived from this software without specific prior written permission.
//
Y
yao 已提交
30
// This software is provided by the copyright holders and contributors as is and
N
niko 已提交
31 32 33 34 35 36 37 38 39 40 41
// any express or implied warranties, including, but not limited to, the implied
// 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,
// indirect, incidental, special, exemplary, or consequential damages
// (including, but not limited to, procurement of substitute goods or services;
// loss of use, data, or profits; or business interruption) however caused
// and on any theory of liability, whether in contract, strict liability,
// 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.
//
//M*/
A
Andrey Kamaev 已提交
42

43 44 45 46 47 48 49 50
#ifdef __GNUC__
#  pragma GCC diagnostic ignored "-Wmissing-declarations"
#  if defined __clang__ || defined __APPLE__
#    pragma GCC diagnostic ignored "-Wmissing-prototypes"
#    pragma GCC diagnostic ignored "-Wextra"
#  endif
#endif

51 52 53
#ifndef __OPENCV_PERF_PRECOMP_HPP__
#define __OPENCV_PERF_PRECOMP_HPP__

Y
yao 已提交
54 55
#include <iomanip>
#include <stdexcept>
N
niko 已提交
56
#include <string>
Y
yao 已提交
57 58 59 60
#include <iostream>
#include <cstdio>
#include <vector>
#include <numeric>
61

N
niko 已提交
62 63
#include "opencv2/core/core.hpp"
#include "opencv2/imgproc/imgproc.hpp"
Y
yao 已提交
64
#include "opencv2/highgui/highgui.hpp"
Y
yao 已提交
65
#include "opencv2/calib3d/calib3d.hpp"
N
niko 已提交
66
#include "opencv2/video/video.hpp"
Y
yao 已提交
67 68
#include "opencv2/objdetect/objdetect.hpp"
#include "opencv2/features2d/features2d.hpp"
N
niko 已提交
69
#include "opencv2/ocl/ocl.hpp"
Y
yao 已提交
70 71
#include "opencv2/ts/ts.hpp"

Y
yao 已提交
72 73 74
using namespace std;
using namespace cv;

75 76 77
#define OCL_SIZE_1000 Size(1000, 1000)
#define OCL_SIZE_2000 Size(2000, 2000)
#define OCL_SIZE_4000 Size(4000, 4000)
Y
yao 已提交
78

79
#define OCL_TYPICAL_MAT_SIZES ::testing::Values(OCL_SIZE_1000, OCL_SIZE_2000, OCL_SIZE_4000)
Y
yao 已提交
80

81
#define OCL_PERF_ENUM(type, ...) ::testing::Values(type, ## __VA_ARGS__ )
Y
yao 已提交
82

83 84 85
#define IMPL_OCL "ocl"
#define IMPL_GPU "gpu"
#define IMPL_PLAIN "plain"
Y
yao 已提交
86

87 88
#define RUN_OCL_IMPL (IMPL_OCL == getSelectedImpl())
#define RUN_PLAIN_IMPL (IMPL_PLAIN == getSelectedImpl())
N
niko 已提交
89

90 91 92
#ifdef HAVE_OPENCV_GPU
# define RUN_GPU_IMPL (IMPL_GPU == getSelectedImpl())
#endif
N
niko 已提交
93

94 95 96 97 98 99 100 101 102 103
#ifdef HAVE_OPENCV_GPU
#define OCL_PERF_ELSE               \
        if (RUN_GPU_IMPL)          \
            CV_TEST_FAIL_NO_IMPL(); \
        else                        \
            CV_TEST_FAIL_NO_IMPL();
#else
#define OCL_PERF_ELSE               \
            CV_TEST_FAIL_NO_IMPL();
#endif
104 105

#endif