updated performance sample

This commit is contained in:
Alexey Spizhevoy 2011-02-01 12:55:05 +00:00
parent e303b0dd62
commit da2d7ee72b
2 changed files with 29 additions and 33 deletions

View File

@ -139,13 +139,9 @@ int CV_CDECL cvErrorCallback(int /*status*/, const char* /*func_name*/,
int main(int argc, char** argv)
{
if (argc < 2)
{
cout << "Usage: performance_gpu <working_dir_with_slash>\n\n";
}
else
{
TestSystem::instance().setWorkingDir(argv[1]);
}
redirectError(cvErrorCallback);
TestSystem::instance().run();

View File

@ -167,32 +167,32 @@ TEST(cornerHarris)
}
TEST(integral)
{
Mat src, sum;
gpu::GpuMat d_src, d_sum, d_buf;
int size = 4000;
gen(src, size, size, CV_8U, 0, 256);
sum.create(size + 1, size + 1, CV_32S);
d_src = src;
d_sum.create(size + 1, size + 1, CV_32S);
for (int i = 0; i < 5; ++i)
{
SUBTEST << "size " << size << ", 8U";
CPU_ON;
integral(src, sum);
CPU_OFF;
GPU_ON;
gpu::integralBuffered(d_src, d_sum, d_buf);
GPU_OFF;
}
}
//TEST(integral)
//{
// Mat src, sum;
// gpu::GpuMat d_src, d_sum, d_buf;
//
// int size = 4000;
//
// gen(src, size, size, CV_8U, 0, 256);
// sum.create(size + 1, size + 1, CV_32S);
//
// d_src = src;
// d_sum.create(size + 1, size + 1, CV_32S);
//
// for (int i = 0; i < 5; ++i)
// {
// SUBTEST << "size " << size << ", 8U";
//
// CPU_ON;
// integral(src, sum);
// CPU_OFF;
//
// GPU_ON;
// gpu::integralBuffered(d_src, d_sum, d_buf);
// GPU_OFF;
// }
//}
TEST(norm)
@ -202,20 +202,20 @@ TEST(norm)
for (int size = 2000; size <= 4000; size += 1000)
{
SUBTEST << "size " << size << ", 32FC4";
SUBTEST << "size " << size << ", 32FC4, NORM_INF";
gen(src, size, size, CV_32FC4, Scalar::all(0), Scalar::all(1));
CPU_ON;
for (int i = 0; i < 5; ++i)
norm(src, NORM_L2);
norm(src, NORM_INF);
CPU_OFF;
d_src = src;
GPU_ON;
for (int i = 0; i < 5; ++i)
gpu::norm(d_src, NORM_L2, d_buf);
gpu::norm(d_src, NORM_INF, d_buf);
GPU_OFF;
}
}