当前位置: 首页>>代码示例>>C++>>正文


C++ BlockT类代码示例

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


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

示例1: exec

 static void exec(BlockT& block, value_type const& val)
 {
   for (vsip::index_type x=0; x<block.size(3, 2); ++x)
     for (vsip::index_type y=0; y<block.size(3, 1); ++y)
       for (vsip::index_type z=0; z<block.size(3, 0); ++z)
         block.put(z, y, x, val);
 }
开发者ID:BackupTheBerlios,项目名称:openvsipl,代码行数:7,代码来源:block_fill.hpp

示例2: rebind_interleaved

void
rebind_interleaved(
  Domain<Dim> const& dom,
  BlockT&            block,
  int                k)
{
  length_type const size = block.size();

  T* data = new T[2*size];
  T* ptr;

  fill_interleaved_array<Order>(data, dom, CFiller<T>(k, 0, 1));

  block.rebind(data);
  
  test_assert(block.admitted()     == false);
  test_assert(block.user_storage() == interleaved_format);

  block.find(ptr);
  test_assert(ptr == data);

  block.admit(true);
  test_assert(block.admitted() == true);

  test_assert(check_block<Order>(block, dom, CFiller<T>(k, 0, 1)));
  fill_block<Order>(block, dom, CFiller<T>(k+1, 0, 1));

  block.release(true);
  test_assert(block.admitted() == false);

  test_assert(check_interleaved_array<Order>(data, dom, CFiller<T>(k+1, 0, 1)));

  delete[] data;
}
开发者ID:BackupTheBerlios,项目名称:openvsipl,代码行数:34,代码来源:user_storage.cpp

示例3: redim_get

typename BlockT::value_type
redim_get(BlockT const& blk, index_type l_idx, integral_constant<int, 3>)
{
  index_type idx[3];

  for (dimension_type d=3; d-->0;)
  {
    idx[d] = l_idx % blk.size(3, d);
    l_idx /= blk.size(3, d);
  }

  return blk.get(idx[0], idx[1], idx[2]);
}
开发者ID:bambang,项目名称:vsipl,代码行数:13,代码来源:redim_block.hpp

示例4: redim_put

void
redim_put(BlockT &blk,
	  index_type l_idx,
	  typename BlockT::value_type value,
	  integral_constant<int, 3>)
{
  index_type idx[3];

  for (dimension_type d=3; d-->0;)
  {
    idx[d] = l_idx % blk.size(3, d);
    l_idx /= blk.size(3, d);
  }

  blk.put(idx[0], idx[1], idx[2], value);
}
开发者ID:bambang,项目名称:vsipl,代码行数:16,代码来源:redim_block.hpp

示例5: redim_get

typename BlockT::value_type
redim_get(BlockT const& blk, index_type l_idx, Int_type<2>)
{
  typedef typename Block_layout<BlockT>::order_type order_type;

  dimension_type dim[2];
  index_type     idx[2];
  dim[0] = order_type::impl_dim0;
  dim[1] = order_type::impl_dim1;

  for (dimension_type d=2; d-->0;)
  {
    idx[dim[d]] = l_idx % blk.size(2, dim[d]);
    l_idx /= blk.size(2, dim[d]);
  }

  return blk.get(idx[0], idx[1]);
}
开发者ID:somaproject,项目名称:thirdparty-packages,代码行数:18,代码来源:eval_dense.hpp

示例6: redim_put

void
redim_put(
  BlockT&                     blk,
  index_type                  l_idx,
  typename BlockT::value_type value,
  Int_type<2>)
{
  typedef typename Block_layout<BlockT>::order_type order_type;

  dimension_type dim[2];
  index_type     idx[2];
  dim[0] = order_type::impl_dim0;
  dim[1] = order_type::impl_dim1;

  for (dimension_type d=2; d-->0;)
  {
    idx[dim[d]] = l_idx % blk.size(2, dim[d]);
    l_idx /= blk.size(2, dim[d]);
  }

  blk.put(idx[0], idx[1], value);
}
开发者ID:somaproject,项目名称:thirdparty-packages,代码行数:22,代码来源:eval_dense.hpp

示例7: rebind_split

void
rebind_split(
  Domain<Dim> const& dom,
  BlockT&            block,
  int                k)
{
  length_type const size = block.size();

  T* real = new T[size];
  T* imag = new T[size];

  T* real_ptr;
  T* imag_ptr;

  fill_split_array<Order>(real, imag, dom, CFiller<T>(k, 0, 1));

  block.rebind(real, imag);

  test_assert(block.admitted()     == false);
  test_assert(block.user_storage() == split_format); // rebind could change format

  block.find(real_ptr, imag_ptr);
  test_assert(real_ptr == real);
  test_assert(imag_ptr == imag);

  block.admit(true);
  test_assert(block.admitted() == true);

  test_assert(check_block<Order>(block, dom, CFiller<T>(k, 0, 1)));
  fill_block<Order>(block, dom, CFiller<T>(k+1, 0, 1));

  block.release(true);
  test_assert(block.admitted() == false);

  test_assert(check_split_array<Order>(real, imag, dom, CFiller<T>(k+1, 0, 1)));

  delete[] real;
  delete[] imag;
}
开发者ID:BackupTheBerlios,项目名称:openvsipl,代码行数:39,代码来源:user_storage.cpp


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