• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ blazemark类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中blazemark的典型用法代码示例。如果您正苦于以下问题:C++ blazemark类的具体用法?C++ blazemark怎么用?C++ blazemark使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了blazemark类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: estimateSteps

/*!\brief Estimating the necessary number of steps for each benchmark.
//
// \param run The parameters for the benchmark run.
// \return void
//
// This function estimates the necessary number of steps for the given benchmark based on the
// performance of the Blaze library.
*/
void estimateSteps( DenseRun& run )
{
   using blazemark::real;
   using blaze::rowVector;
   using blaze::columnMajor;

   const size_t N( run.getSize() );

   blaze::StaticVector<real,6UL,rowVector> vec( 0.1 );
   blaze::StaticMatrix<real,6UL,6UL,columnMajor> mat( 0.1 );
   std::vector< blaze::StaticVector<real,6UL,rowVector> > a( N, vec ), b( N );
   std::vector< blaze::StaticMatrix<real,6UL,6UL,columnMajor> > A( N, mat );
   blaze::timing::WcTimer timer;
   double wct( 0.0 );
   size_t steps( 1UL );

   while( true ) {
      timer.start();
      for( size_t step=0UL, i=0UL; step<steps; ++step, ++i ) {
         if( i == N ) i = 0UL;
         b[i] = a[i] * A[i];
      }
      timer.end();
      wct = timer.last();
      if( wct >= 0.2 ) break;
      steps *= 2UL;
   }

   for( size_t i=0UL; i<N; ++i )
      if( b[i][0] < real(0) )
         std::cerr << " Line " << __LINE__ << ": ERROR detected!!!\n";

   run.setSteps( blaze::max( 1UL, ( blazemark::runtime * steps ) / timer.last() ) );
}
开发者ID:,项目名称:,代码行数:42,代码来源:


示例2: estimateSteps

/*!\brief Estimating the necessary number of steps for each benchmark.
//
// \param run The parameters for the benchmark run.
// \return void
//
// This function estimates the necessary number of steps for the given benchmark based on the
// performance of the Blaze library.
*/
void estimateSteps( Run& run )
{
   using blazemark::element_t;
   using blaze::rowMajor;

   ::blaze::setSeed( ::blazemark::seed );

   const size_t N( run.getSize() );

   blaze::DynamicMatrix<element_t,rowMajor> A( N, N ), B( N, N );
   blaze::timing::WcTimer timer;
   double wct( 0.0 );
   size_t steps( 1UL );

   blazemark::blaze::init( A );

   while( true ) {
      timer.start();
      for( size_t i=0UL; i<steps; ++i ) {
         B = A * element_t(3);
      }
      timer.end();
      wct = timer.last();
      if( wct >= 0.2 ) break;
      steps *= 2UL;
   }

   if( B.rows() != N )
      std::cerr << " Line " << __LINE__ << ": ERROR detected!!!\n";

   run.setSteps( blaze::max( 1UL, ( blazemark::runtime * steps ) / timer.last() ) );
}
开发者ID:EricSchles,项目名称:blaze-lib,代码行数:40,代码来源:DMatScalarMult.cpp


示例3: estimateSteps

/*!\brief Estimating the necessary number of steps for each benchmark.
//
// \param run The parameters for the benchmark run.
// \return void
//
// This function estimates the necessary number of steps for the given benchmark based on the
// performance of the Blaze library.
*/
void estimateSteps( Run& run )
{
   using blazemark::element_t;
   using blaze::columnVector;

   ::blaze::setSeed( ::blazemark::seed );

   const size_t N( run.getSize() );

   blaze::DynamicVector<element_t,columnVector> a( N );
   element_t scalar( 0 );
   blaze::timing::WcTimer timer;
   double wct( 0.0 );
   size_t steps( 1UL );

   blazemark::blaze::init( a );

   while( true ) {
      timer.start();
      for( size_t i=0UL; i<steps; ++i ) {
         scalar += trans( a ) * a;
      }
      timer.end();
      wct = timer.last();
      if( wct >= 0.2 ) break;
      steps *= 2UL;
   }

   if( scalar < element_t(0) )
      std::cerr << " Line " << __LINE__ << ": ERROR detected!!!\n";

   run.setSteps( blaze::max( 1UL, ( blazemark::runtime * steps ) / timer.last() ) );
}
开发者ID:EricSchles,项目名称:blaze-lib,代码行数:41,代码来源:DVecNorm.cpp


示例4: estimateSteps

/*!\brief Estimating the necessary number of steps for each benchmark.
//
// \param run The parameters for the benchmark run.
// \return void
//
// This function estimates the necessary number of steps for the given benchmark based on the
// performance of the Blaze library.
*/
void estimateSteps( Run& run )
{
   using blazemark::element_t;
   using blaze::rowMajor;
   using blaze::columnMajor;

   typedef blaze::StaticMatrix<element_t,6UL,6UL,rowMajor>     RowMajorMatrixType;
   typedef blaze::StaticMatrix<element_t,6UL,6UL,columnMajor>  ColumnMajorMatrixType;
   typedef blaze::AlignedAllocator<RowMajorMatrixType>         RowMajorAllocatorType;
   typedef blaze::AlignedAllocator<ColumnMajorMatrixType>      ColumnMajorAllocatorType;

   blaze::setSeed( blazemark::seed );

   const size_t N( run.getNumber() );

   std::vector< RowMajorMatrixType, RowMajorAllocatorType > A( N ), C( N );
   std::vector< ColumnMajorMatrixType, ColumnMajorAllocatorType > B( N );
   blaze::timing::WcTimer timer;
   double wct( 0.0 );
   size_t steps( 1UL );

   blazemark::blaze::init( A );
   blazemark::blaze::init( B );

   while( true ) {
      timer.start();
      for( size_t step=0UL, i=0UL; step<steps; ++step, ++i ) {
         if( i == N ) i = 0UL;
         C[i] = A[i] * B[i];
      }
      timer.end();
      wct = timer.last();
      if( wct >= 0.2 ) break;
      steps *= 2UL;
   }

   for( size_t i=0UL; i<N; ++i )
      if( C[i](0,0) < element_t(0) )
         std::cerr << " Line " << __LINE__ << ": ERROR detected!!!\n";

   run.setSteps( blaze::max( 1UL, ( blazemark::runtime * steps ) / timer.last() ) );
}
开发者ID:EricSchles,项目名称:blaze-lib,代码行数:50,代码来源:Mat6TMat6Mult.cpp


示例5: estimateSteps

/*!\brief Estimating the necessary number of steps for each benchmark.
//
// \param run The parameters for the benchmark run.
// \return void
//
// This function estimates the necessary number of steps for the given benchmark based on the
// performance of the Blaze library.
*/
void estimateSteps( Run& run )
{
   using blazemark::element_t;
   using blaze::rowVector;
   using blaze::rowMajor;

   typedef blaze::StaticVector<element_t,3UL,rowVector>     VectorType;
   typedef blaze::StaticMatrix<element_t,3UL,3UL,rowMajor>  MatrixType;
   typedef blaze::AlignedAllocator<VectorType>              VectorAllocatorType;
   typedef blaze::AlignedAllocator<MatrixType>              MatrixAllocatorType;

   blaze::setSeed( blazemark::seed );

   const size_t N( run.getNumber() );

   std::vector< VectorType, VectorAllocatorType > a( N ), b( N );
   std::vector< MatrixType, MatrixAllocatorType > A( N );
   blaze::timing::WcTimer timer;
   double wct( 0.0 );
   size_t steps( 1UL );

   blazemark::blaze::init( a );
   blazemark::blaze::init( A );

   while( true ) {
      timer.start();
      for( size_t step=0UL, i=0UL; step<steps; ++step, ++i ) {
         if( i == N ) i = 0UL;
         b[i] = a[i] * A[i];
      }
      timer.end();
      wct = timer.last();
      if( wct >= 0.2 ) break;
      steps *= 2UL;
   }

   for( size_t i=0UL; i<N; ++i )
      if( b[i][0] < element_t(0) )
         std::cerr << " Line " << __LINE__ << ": ERROR detected!!!\n";

   run.setSteps( blaze::max( 1UL, ( blazemark::runtime * steps ) / timer.last() ) );
}
开发者ID:EricSchles,项目名称:blaze-lib,代码行数:50,代码来源:TVec3Mat3Mult.cpp



注:本文中的blazemark类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ ble_bondmngr_init_t类代码示例发布时间:2022-05-31
下一篇:
C++ blargg_vector类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap