barrier(CLK_LOCAL_MEM_FENCE);
if (tid < 16)
- {
data[tid] = *partial_reduction = op(partial_reduction, data[tid + 16]);
+ barrier(CLK_LOCAL_MEM_FENCE);
+ if (tid < 8)
data[tid] = *partial_reduction = op(partial_reduction, data[tid + 8 ]);
+ barrier(CLK_LOCAL_MEM_FENCE);
+ if (tid < 4)
data[tid] = *partial_reduction = op(partial_reduction, data[tid + 4 ]);
+ barrier(CLK_LOCAL_MEM_FENCE);
+ if (tid < 2)
data[tid] = *partial_reduction = op(partial_reduction, data[tid + 2 ]);
+ barrier(CLK_LOCAL_MEM_FENCE);
+ if (tid < 1)
data[tid] = *partial_reduction = op(partial_reduction, data[tid + 1 ]);
- }
#undef op
}
{
// compute unnormalized descriptors, then normalize them - odd indexing since grid must be 2D
Context *clCxt = descriptors.clCxt;
- string kernelName = "";
+ string kernelName;
vector< pair<size_t, const void *> > args;
size_t localThreads[3] = {1, 1, 1};
size_t globalThreads[3] = {1, 1, 1};
{
cmd.printParams();
return 0;
- }
+ }
printCudaInfo();
if (cmd.get<bool>("info"))
- {
+ {
return 0;
- }
+ }
int device = cmd.get<int>("device");
if (device < 0)
- {
+ {
DeviceManager::instance().loadAll();
std::cout << "Run tests on all supported devices \n" << std::endl;
- }
+ }
else
- {
+ {
DeviceManager::instance().load(device);
DeviceInfo info(device);
std::cout << "Run tests on device " << device << " [" << info.name() << "] \n" << std::endl;
- }
+}
TS::ptr()->init("cv");
InitGoogleTest(&argc, argv);
return -1;
}
catch (...)
- {
+{
std::cerr << "Unknown error" << std::endl;
return -1;
}
static bool keyPointsEquals(const cv::KeyPoint& p1, const cv::KeyPoint& p2)
{
- const double maxPtDif = 1.0;
- const double maxSizeDif = 1.0;
- const double maxAngleDif = 2.0;
- const double maxResponseDif = 0.1;
+ const double maxPtDif = 0.1;
+ const double maxSizeDif = 0.1;
+ const double maxAngleDif = 0.1;
+ const double maxResponseDif = 0.01;
double dist = cv::norm(p1.pt - p2.pt);
return false;
}
-#define ASSERT_KEYPOINTS_EQ(gold, actual) EXPECT_PRED_FORMAT2(assertKeyPointsEquals, gold, actual);
-
static int getMatchedPointsCount(std::vector<cv::KeyPoint>& gold, std::vector<cv::KeyPoint>& actual)
{
std::sort(actual.begin(), actual.end(), perf::comparators::KeypointGreater());
#define PARAM_TEST_CASE(name, ...) struct name : testing::TestWithParam< std::tr1::tuple< __VA_ARGS__ > >
#define IMPLEMENT_PARAM_CLASS(name, type) \
- namespace { \
- class name \
- { \
+ namespace { class name { \
public: \
name ( type arg = type ()) : val_(arg) {} \
operator type () const {return val_;} \
private: \
type val_; \
}; \
- inline void PrintTo( name param, std::ostream* os) \
- { \
- *os << #name << "(" << testing::PrintToString(static_cast< type >(param)) << ")"; \
- }}
+ inline void PrintTo( name param, std::ostream* os) {*os << #name << "=" << testing::PrintToString(static_cast< type >(param));}}
IMPLEMENT_PARAM_CLASS(HessianThreshold, double)
IMPLEMENT_PARAM_CLASS(Octaves, int)
int matchedCount = getMatchedPointsCount(keypoints_gold, keypoints);
double matchedRatio = static_cast<double>(matchedCount) / keypoints_gold.size();
- EXPECT_GT(matchedRatio, 0.95);
+ EXPECT_GT(matchedRatio, 0.99);
}
-TEST_P(SURF, Descriptor)
+TEST_P(SURF, DISABLED_Descriptor)
{
cv::Mat image = cv::imread(string(cvtest::TS::ptr()->get_data_path()) + "shared/fruits.png", cv::IMREAD_GRAYSCALE);
ASSERT_FALSE(image.empty());