本文整理汇总了C++中BlockT::size方法的典型用法代码示例。如果您正苦于以下问题:C++ BlockT::size方法的具体用法?C++ BlockT::size怎么用?C++ BlockT::size使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BlockT
的用法示例。
在下文中一共展示了BlockT::size方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
示例2:
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]);
}
示例3:
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;
}
示例4:
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]);
}