本文整理汇总了C++中vex::Context::size方法的典型用法代码示例。如果您正苦于以下问题:C++ Context::size方法的具体用法?C++ Context::size怎么用?C++ Context::size使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类vex::Context
的用法示例。
在下文中一共展示了Context::size方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: run_tests
void run_tests(const vex::Context &ctx, vex::profiler<> &prof, int n_size)
{
std::cout
<< "----------------------------------------------------------\n"
<< "Profiling \"" << vex::type_name<real>() << "\" performance\n"
<< "----------------------------------------------------------\n"
<< ctx << std::endl;
std::ostringstream fname;
fname << "profile_" << vex::type_name<real>() << ".dat";
std::ofstream log(fname.str().c_str(), std::ios::app);
log << ctx.size() << " ";
double gflops, bwidth;
prof.tic_cpu( vex::type_name<real>() );
if (options.bm_saxpy) {
prof.tic_cpu("Vector SAXPY");
std::tie(gflops, bwidth) = benchmark_saxpy<real>(ctx, prof);
prof.toc("Vector SAXPY");
log << gflops << " " << bwidth << " ";
}
if (options.bm_vector) {
prof.tic_cpu("Vector arithmetic");
std::tie(gflops, bwidth) = benchmark_vector<real>(ctx, prof);
prof.toc("Vector arithmetic");
log << gflops << " " << bwidth << " ";
}
if (options.bm_reductor) {
prof.tic_cpu("Reduction");
std::tie(gflops, bwidth) = benchmark_reductor<real>(ctx, prof, n_size);
prof.toc("Reduction");
log << gflops << " " << bwidth << " ";
}
if (options.bm_stencil) {
prof.tic_cpu("Stencil");
std::tie(gflops, bwidth) = benchmark_stencil<real>(ctx, prof);
prof.toc("Stencil");
log << gflops << " " << bwidth << " ";
}
if (options.bm_spmv) {
prof.tic_cpu("SpMV");
std::tie(gflops, bwidth) = benchmark_spmv<real>(ctx, prof);
prof.toc("SpMV");
log << gflops << " " << bwidth << std::endl;
prof.tic_cpu("SpMV (CCSR)");
std::tie(gflops, bwidth) = benchmark_spmv_ccsr<real>(ctx, prof);
prof.toc("SpMV (CCSR)");
}
if (options.bm_rng) {
prof.tic_cpu("Random number generation");
benchmark_rng<real>(ctx, prof);
prof.toc("Random number generation");
}
if (options.bm_sort) {
prof.tic_cpu("Sorting");
benchmark_sort<real>(ctx, prof);
prof.toc("Sorting");
}
/*
if (options.bm_scan) {
prof.tic_cpu("Scanning");
benchmark_scan<real>(ctx, prof);
prof.toc("Scanning");
}
*/
prof.toc( vex::type_name<real>() );
std::cout << std::endl << std::endl;
}